behaviour refactoring. storage beahavior added

This commit is contained in:
azykov@mail.ru
2026-09-03 12:31:23 +03:00
parent 557d22517a
commit f4c1eedf62
10 changed files with 158 additions and 120 deletions
+16 -36
View File
@@ -9,19 +9,7 @@ export const defaultGame: () => SerializedGame = () => ({
behaviour: {
id: 'forest.1',
kind: 'converter',
inputs: {
pins: [],
},
outputs: {
pins: [
{
resource: 'tree',
},
{
resource: 'stone',
},
],
},
inputLinks: { pins: [] },
rules: {
cycleLength: 1,
outputRates: { tree: 1, stone: 0.1 },
@@ -34,21 +22,14 @@ export const defaultGame: () => SerializedGame = () => ({
behaviour: {
id: 'sawmill.1',
kind: 'converter',
inputs: {
inputLinks: {
pins: [
{
resource: 'tree',
link: { target: 'forest.1', resource: 'tree' },
target: 'forest.1',
},
]
},
outputs: {
pins: [
{
resource: 'wood',
},
],
},
rules: {
cycleLength: 1.8,
inputRates: { tree: 1 },
@@ -57,26 +38,25 @@ export const defaultGame: () => SerializedGame = () => ({
},
},
{
id: 'burner',
name: 'Магазин досок',
id: 'shop',
name: 'Магазин',
behaviour: {
id: 'burner.1',
kind: 'converter',
inputs: {
id: 'shop.1',
kind: 'storage',
inputLinks: {
pins: [
{
resource: 'wood',
link: { target: 'sawmill.1', resource: 'wood' },
target: 'sawmill.1',
},
],
},
outputs: {
pins: [],
},
rules: {
cycleLength: 1,
inputRates: { wood: 1 },
{
resource: 'stone',
target: 'forest.1',
}
]
},
acceptsResources: ['wood', 'stone'],
items: {},
},
},
],