Add Recipemanager that loads recipes from YAML
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
!ruby:object/MyCustomClass
|
||||
string_val: alternate tag
|
||||
int_val: 42
|
||||
float_val: 1.61803398875
|
||||
color_val: !Color 000000
|
||||
@@ -0,0 +1 @@
|
||||
uid://deqds0xtv6aoi
|
||||
@@ -0,0 +1,5 @@
|
||||
title: Document 1
|
||||
---
|
||||
title: Document 2
|
||||
---
|
||||
title: Document 3
|
||||
@@ -0,0 +1 @@
|
||||
uid://cwyofk32x3sba
|
||||
@@ -0,0 +1,16 @@
|
||||
# The $id string is used as an identifier
|
||||
$schema: "res://my_custom_class.yaml"
|
||||
|
||||
type: object
|
||||
properties:
|
||||
string_val:
|
||||
type: string
|
||||
minLength: 0
|
||||
maxLength: 5
|
||||
int_val:
|
||||
type: int
|
||||
max: 10
|
||||
float_val:
|
||||
type: float
|
||||
min: 1
|
||||
max: 999
|
||||
@@ -0,0 +1 @@
|
||||
uid://cpf0ajyys57i2
|
||||
@@ -0,0 +1,17 @@
|
||||
# The $id string is used as an identifier
|
||||
$id: "res://my_custom_class_schema.yaml"
|
||||
|
||||
type: object
|
||||
x-yaml-tag: foobar
|
||||
properties:
|
||||
string_val:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 5
|
||||
int_val:
|
||||
type: int
|
||||
max: 10
|
||||
float_val:
|
||||
type: float
|
||||
min: 0
|
||||
max: 999
|
||||
@@ -0,0 +1 @@
|
||||
uid://fkxxl0sy2xrm
|
||||
@@ -0,0 +1,7 @@
|
||||
title: Godot YAML
|
||||
author: FimbulWorks
|
||||
release_year: 2025
|
||||
features:
|
||||
- Speaks fluent Variant and can be taught custom classes
|
||||
- Strong document formatting capabilities
|
||||
- Blazingly fast
|
||||
@@ -0,0 +1 @@
|
||||
uid://dn5kwv25bhn5g
|
||||
@@ -0,0 +1,179 @@
|
||||
# Strings
|
||||
plain_string: Hello World
|
||||
single_quoted_string: 'Hello, ''World'''
|
||||
double_quoted_string: "Hello, World!"
|
||||
literal_string: |
|
||||
This is a long string
|
||||
that will preserve
|
||||
newlines
|
||||
folded_string: >
|
||||
This is a long string
|
||||
that will be folded
|
||||
into a single line
|
||||
|
||||
# Integer formats
|
||||
integer: 42
|
||||
hex: 0xff
|
||||
octal: 0o700
|
||||
binary: 0b1010
|
||||
|
||||
# Float formats
|
||||
float: 3.14159
|
||||
scientific_notation: 6.022e23
|
||||
infinity: .inf
|
||||
not_a_number: .nan
|
||||
|
||||
# Boolean types
|
||||
boolean_true: true
|
||||
boolean_false: false
|
||||
|
||||
# Null
|
||||
null_value: null
|
||||
null_value_2: ~
|
||||
|
||||
# Dates and times are treated as strings
|
||||
date: 2023-04-01
|
||||
canonical_datetime: 2023-04-01T12:00:00Z
|
||||
iso8601_datetime: 2023-04-01t12:00:00.000-05:00
|
||||
|
||||
# Arrays
|
||||
fruits:
|
||||
- apple
|
||||
- banana
|
||||
- cherry
|
||||
|
||||
nested_array:
|
||||
- - nested
|
||||
- items
|
||||
- - more
|
||||
- nested
|
||||
- items
|
||||
|
||||
## Dictionaries
|
||||
person:
|
||||
name: John Doe
|
||||
age: 30
|
||||
occupation: Developer
|
||||
|
||||
## Flow style array
|
||||
flow_style_array: [1, 2, 3, 4, 5]
|
||||
|
||||
## Flow style dictionary
|
||||
flow_style_dict: {key1: value1, key2: value2, key3: 124.5}
|
||||
|
||||
## Nested flow array
|
||||
nested_flow_style_array: ["hello", 10, {foo: bar}, [4.20, 6.9]]
|
||||
|
||||
## Nested flow dictionary
|
||||
nested_flow_style_dictionary: { key1: {foo: 'bar'}, key2: [4.20, 6.9] }
|
||||
|
||||
# Anchors and aliases get resolved during parsing
|
||||
anchor_example: &anchor_name
|
||||
key1: value1
|
||||
key2: value2
|
||||
|
||||
alias_example: *anchor_name
|
||||
|
||||
# Merge keys are also resolved during parsing
|
||||
base: &base
|
||||
name: John Doe
|
||||
age: 30
|
||||
|
||||
merge_example:
|
||||
<<: *base
|
||||
occupation: Developer
|
||||
|
||||
# Binary data - !!binary is converted to !PackedByteArray
|
||||
binary_data: !!binary |
|
||||
R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
|
||||
OTk6enp56enmleECcgggoBADs=
|
||||
|
||||
# Custom tags are preserved, and can describe Godot Variants,
|
||||
# and classes registered using YAML.register_class()
|
||||
game_object: !MyHeroClass
|
||||
name: "Hero"
|
||||
health: 100
|
||||
inventory:
|
||||
- sword
|
||||
- shield
|
||||
- potion_healing
|
||||
|
||||
# Variants
|
||||
AABB: !AABB
|
||||
position: {x: 1,y: 2,z: 4}
|
||||
size: {x: 8,y: 16,z: 32}
|
||||
Basis: !Basis
|
||||
x: {x: 1,y: 2,z: 4}
|
||||
y: {x: 8,y: 16,z: 32}
|
||||
z: {x: 64,y: 128,z: 256}
|
||||
Color: !Color ff804080
|
||||
NodePath: !NodePath "root/level/player"
|
||||
PackedByteArray: !PackedByteArray |
|
||||
AQIECA==
|
||||
PackedColorArray: !PackedColorArray
|
||||
- ff0000
|
||||
- 00ff00
|
||||
- 0000ff
|
||||
- red
|
||||
- green
|
||||
- blue
|
||||
PackedFloat32Array: !PackedFloat32Array
|
||||
- 3.1415927
|
||||
- 6.2831855
|
||||
- 12.566371
|
||||
PackedFloat64Array: !PackedFloat64Array
|
||||
- 3.141592653589793
|
||||
- 6.283185307179586
|
||||
- 12.566370614359172
|
||||
PackedInt32Array: !PackedInt32Array
|
||||
- 1
|
||||
- 2
|
||||
- 4
|
||||
- 8
|
||||
PackedInt64Array: !PackedInt64Array
|
||||
- 1
|
||||
- 2
|
||||
- 4
|
||||
- 8
|
||||
PackedStringArray: !PackedStringArray
|
||||
- "one"
|
||||
- "one\ntwo"
|
||||
- "one\ntwo\nthree"
|
||||
PackedVector2Array: !PackedVector2Array
|
||||
- {x: 1,y: 2}
|
||||
- {x: 4,y: 8}
|
||||
PackedVector3Array: !PackedVector3Array
|
||||
- {x: 1,y: 2,z: 4}
|
||||
- {x: 8,y: 16,z: 32}
|
||||
Plane: !Plane
|
||||
normal: {x: 1,y: 2,z: 4}
|
||||
d: 3.1415927
|
||||
Projection: !Projection
|
||||
x: {x: 1,y: 2,z: 4,w: 8}
|
||||
y: {x: 16,y: 32,z: 64,w: 128}
|
||||
z: {x: 256,y: 512,z: 1024,w: 2048}
|
||||
w: {x: 4096,y: 8192,z: 16384,w: 32768}
|
||||
Quaternion: !Quaternion {x: 3.1415927,y: 6.2831855,z: 12.566371,w: 25.132742}
|
||||
Rect2: !Rect2
|
||||
position: {x: 1,y: 2}
|
||||
size: {x: 4,y: 8}
|
||||
Rect2i: !Rect2i
|
||||
position: {x: 2,y: 4}
|
||||
size: {x: 8,y: 16}
|
||||
StringName: !StringName test_string_name
|
||||
Transform2D: !Transform2D
|
||||
x: {x: -1,y: -8.742278e-08}
|
||||
y: {x: 8.742278e-08,y: -1}
|
||||
origin: {x: 6.2831855,y: 12.566371}
|
||||
Transform3D: !Transform3D
|
||||
basis:
|
||||
x: {x: 1,y: 0,z: 0}
|
||||
y: {x: 0,y: 1,z: 0}
|
||||
z: {x: 0,y: 0,z: 1}
|
||||
origin: {x: 1,y: 2,z: 4}
|
||||
Vector2: !Vector2 {x: 1,y: 2}
|
||||
Vector2i: !Vector2i {x: 2,y: 4}
|
||||
Vector3: !Vector3 {x: 1,y: 2,z: 4}
|
||||
Vector3i: !Vector3i {x: 2,y: 4,z: 8}
|
||||
Vector4: !Vector4 {x: 1,y: 2,z: 4,w: 8}
|
||||
Vector4i: !Vector4i {x: 2,y: 4,z: 8,w: 16}
|
||||
@@ -0,0 +1 @@
|
||||
uid://b24xb1mhxmg8i
|
||||
@@ -0,0 +1,50 @@
|
||||
$schema: "res://addons/yaml/examples/data/fimbul.generator.schema.yaml"
|
||||
params:
|
||||
x: float
|
||||
y: float
|
||||
noiseScale: float
|
||||
noise2D: Callable
|
||||
|
||||
functions:
|
||||
- name: continentShape
|
||||
params: ["x", "y"]
|
||||
returns: float
|
||||
code: abs(cos(x * PI * 2 + PI * 0.5) * sin(y * PI))
|
||||
|
||||
- name: heightNoise
|
||||
params: ["x", "y", "noiseScale", "noise2D"]
|
||||
returns: float
|
||||
code: noise2D(x * noiseScale, y * noiseScale) * 0.5 + 0.5
|
||||
|
||||
- name: height
|
||||
dependencies: ["continentShape", "heightNoise"]
|
||||
returns: float
|
||||
code: continentShape * heightNoise
|
||||
|
||||
- name: temperature
|
||||
params: ["y"]
|
||||
dependencies: ["height"]
|
||||
returns: float
|
||||
code: y - (height - 0.4) * 2 if height > 0.4 else y
|
||||
|
||||
- name: precipitation
|
||||
params: ["y"]
|
||||
dependencies: ["temperature"]
|
||||
returns: float
|
||||
code: 1 - temperature
|
||||
|
||||
- name: biome
|
||||
returns: String
|
||||
dependencies: ["height", "temperature", "precipitation"]
|
||||
code: |
|
||||
if height < 0.2023:
|
||||
return 'ocean'
|
||||
if temperature >= 0.666:
|
||||
return 'desert'
|
||||
if temperature > 0.42 && precipitation > 0.42:
|
||||
return 'rainforest'
|
||||
if temperature > 0.3 && precipitation > 0.3:
|
||||
return 'forest'
|
||||
if temperature <= 0.21:
|
||||
return 'tundra'
|
||||
return 'meadows'
|
||||
@@ -0,0 +1 @@
|
||||
uid://drfjm1uj06e4x
|
||||
Reference in New Issue
Block a user