Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions ECS_RGO_DAG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```mermaid
flowchart TD
classDef prov fill:#1f3a5f,stroke:#9ecbff,color:#eaf2ff;
classDef pop fill:#3a2f1f,stroke:#ffce9e,color:#fff3e6;

S1["Stage 1<br/>RgoComputePopulationTotalsSystem<br/><i>over provinces</i>"]:::prov
S2["Stage 2<br/>RgoHireSystem<br/><i>over provinces</i>"]:::prov
S3["Stage 3<br/>RgoProduceAndPlaceOrderSystem<br/><i>over provinces</i>"]:::prov
S4["Stage 4<br/>RgoResolveSellOrderAndOwnerShareSystem<br/><i>over provinces</i>"]:::prov
S5a["Stage 5a<br/>RgoComputeOwnerIncomeSystem<br/><i>over provinces</i>"]:::prov
S5b["Stage 5b<br/>RgoComputeEmployeeIncomeSystem<br/><i>over provinces</i>"]:::prov
S6a["Stage 6a<br/>ApplyEmployeeIncomeToPopsSystem<br/><i>over pops</i>"]:::pop
S6b["Stage 6b<br/>ApplyOwnerIncomeToPopsSystem<br/><i>over pops</i>"]:::pop
S7["Stage 7<br/>AggregatePopIncomeSystem<br/><i>over pops</i>"]:::pop

S1 --> S2 --> S3 --> S4
S4 --> S5a
S4 --> S5b
S5b --> S6a
S5a --> S6b
S6a --> S7
S6b --> S7
```
85 changes: 85 additions & 0 deletions ECS_RGO_DATAFLOW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
```mermaid
flowchart LR
classDef sys fill:#243b53,stroke:#9ecbff,color:#eaf2ff;
classDef prov fill:#102a43,stroke:#5b8fc9,color:#d6e6ff;
classDef pop fill:#3a2f1f,stroke:#ffce9e,color:#fff3e6;
classDef sing fill:#2b2b2b,stroke:#9e9e9e,color:#eee;

%% Singletons
REG["RgoProductionTypeRegistry"]:::sing
PRICE["RgoMarketPriceTable"]:::sing
RULES["RgoGameRules"]:::sing

%% Systems
S1["RgoComputePopulationTotalsSystem"]:::sys
S2["RgoHireSystem"]:::sys
S3["RgoProduceAndPlaceOrderSystem"]:::sys
S4["RgoResolveSellOrderAndOwnerShareSystem"]:::sys
S5a["RgoComputeOwnerIncomeSystem"]:::sys
S5b["RgoComputeEmployeeIncomeSystem"]:::sys
S6a["ApplyEmployeeIncomeToPopsSystem"]:::sys
S6b["ApplyOwnerIncomeToPopsSystem"]:::sys
S7["AggregatePopIncomeSystem"]:::sys

%% Province components
CACHE["ProvinceRgoCacheTotals"]:::prov
HIRED["ProvinceRgoHired"]:::prov
ORDER["ProvinceRgoSellOrder"]:::prov
RESULT["ProvinceRgoResult"]:::prov
OINC["ProvinceRgoOwnerIncome"]:::prov
EINC["ProvinceRgoEmployeeIncome"]:::prov

%% Pop components
PWI["PopWorkerIncome"]:::pop
POI["PopOwnerIncome"]:::pop
PIT["PopIncomeTotals"]:::pop

%% Stage 1
REG -.->|lookup| S1
S1 -->|writes| CACHE

%% Stage 2
CACHE -->|reads| S2
REG -.->|lookup| S2
S2 -->|writes| HIRED

%% Stage 3
HIRED -->|reads| S3
CACHE -->|reads| S3
REG -.->|lookup| S3
RULES -.->|lookup| S3
S3 -->|"writes output_quantity"| RESULT
S3 -->|writes| ORDER

%% Stage 4
ORDER -->|reads + clears| S4
PRICE -.->|lookup| S4
CACHE -->|reads| S4
S4 -->|"writes revenue, owner_share,<br/>total_minimum_wage"| RESULT
S4 -->|"writes employee min wages"| HIRED

%% Stage 5
RESULT -->|reads| S5a
CACHE -->|reads| S5a
REG -.->|lookup| S5a
S5a -->|writes| OINC

RESULT -->|reads| S5b
HIRED -->|reads| S5b
S5b -->|writes| EINC

%% Stage 6
HIRED -.->|reads| S6a
EINC -.->|reads| S6a
S6a -->|writes| PWI

RESULT -.->|reads| S6b
CACHE -.->|reads| S6b
REG -.->|lookup| S6b
S6b -->|writes| POI

%% Stage 7
PWI -->|reads| S7
POI -->|reads| S7
S7 -->|"writes total + cash"| PIT
```
Loading
Loading