Skip to content

Commit ef55f8a

Browse files
committed
Rename carbon component to global carbon component.
1 parent 3745c67 commit ef55f8a

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

entities/components/carbon_component.gd renamed to entities/components/global_carbon_component.gd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
extends Node
2-
class_name CarbonComponent
2+
class_name GlobalCarbonComponent
33

4-
@onready var view_model = CarbonViewModel.new()
4+
@onready var view_model = GlobalCarbonViewModel.new()
55
@export var time_component: TimeComponent
66

77
var carbon_level_ppm: float
88

99
func _ready():
10-
ViewModelRegistry.register(ViewModelRegistry.Keys.CARBON, view_model)
10+
ViewModelRegistry.register(ViewModelRegistry.Keys.GLOBAL_CARBON, view_model)
1111
time_component.on_new_month.connect(_handle_new_month)
1212

1313
func _handle_new_month(new_timestamp: float):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[gd_scene load_steps=2 format=3 uid="uid://bcq54x0laubvw"]
22

3-
[ext_resource type="Script" path="res://entities/components/carbon_component.gd" id="1_aa2fy"]
3+
[ext_resource type="Script" path="res://entities/components/global_carbon_component.gd" id="1_aa2fy"]
44

55
[node name="CarbonComponent" type="Node"]
66
script = ExtResource("1_aa2fy")

scenes/common/standard_game_mode.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class_name StandardGameMode
77
@export var loss_temperature_anomaly: float = 1.50
88
@export var time_component: TimeComponent;
99
@export var temperature_component: TemperatureComponent
10-
@export var carbon_component: CarbonComponent
10+
@export var global_carbon_component: GlobalCarbonComponent
1111

1212
var loss_timestamp: int
1313
var view_model: GameModeViewModel = GameModeViewModel.new()
@@ -20,7 +20,7 @@ func _ready() -> void:
2020
time_component.on_new_day.connect(_handle_new_day)
2121
temperature_component.on_temperature_anomaly_changed.connect(_handle_new_temperature_anomaly)
2222
ViewModelRegistry.register(ViewModelRegistry.Keys.GAME_MODE, view_model)
23-
carbon_component.set_carbon_in_atmosphere(carbon_in_atmosphere_ppm)
23+
global_carbon_component.set_carbon_in_atmosphere(carbon_in_atmosphere_ppm)
2424

2525
func _handle_new_day(new_timestamp: float) -> void:
2626
if new_timestamp >= loss_timestamp:

scenes/main/main.tscn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[ext_resource type="PackedScene" uid="uid://b1x0140gst6wf" path="res://entities/components/time_component.tscn" id="5_6js18"]
1010
[ext_resource type="PackedScene" uid="uid://cxdm1p8x2yt7d" path="res://entities/components/temperature_component.tscn" id="5_p0y26"]
1111
[ext_resource type="PackedScene" uid="uid://bs84f822v0oba" path="res://scenes/components/cheat_component.tscn" id="6_6lkyn"]
12-
[ext_resource type="PackedScene" uid="uid://bcq54x0laubvw" path="res://entities/components/carbon_component.tscn" id="7_xe0mx"]
12+
[ext_resource type="PackedScene" uid="uid://bcq54x0laubvw" path="res://entities/components/global_carbon_component.tscn" id="7_xe0mx"]
1313
[ext_resource type="PackedScene" uid="uid://7e58nln2jjm5" path="res://ui/widgets/modal_loss.tscn" id="10_f2gcx"]
1414
[ext_resource type="PackedScene" uid="uid://c57b4mhnpqlmr" path="res://scenes/common/standard_game_mode.tscn" id="10_o6r5s"]
1515

@@ -32,16 +32,16 @@ time_component = NodePath("../TimeComponent")
3232

3333
[node name="CheatComponent" parent="Components" instance=ExtResource("6_6lkyn")]
3434

35-
[node name="CarbonComponent" parent="Components" node_paths=PackedStringArray("time_component") instance=ExtResource("7_xe0mx")]
35+
[node name="GlobalCarbonComponent" parent="Components" node_paths=PackedStringArray("time_component") instance=ExtResource("7_xe0mx")]
3636
time_component = NodePath("../TimeComponent")
3737

3838
[node name="WorldMap" parent="." instance=ExtResource("1_cjno1")]
3939
position = Vector2(0, 1)
4040

41-
[node name="StandardGameMode" parent="." node_paths=PackedStringArray("time_component", "temperature_component", "carbon_component") instance=ExtResource("10_o6r5s")]
41+
[node name="StandardGameMode" parent="." node_paths=PackedStringArray("time_component", "temperature_component", "global_carbon_component") instance=ExtResource("10_o6r5s")]
4242
time_component = NodePath("../Components/TimeComponent")
4343
temperature_component = NodePath("../Components/TemperatureComponent")
44-
carbon_component = NodePath("../Components/CarbonComponent")
44+
global_carbon_component = NodePath("../Components/GlobalCarbonComponent")
4545

4646
[node name="CanvasLayer" type="CanvasLayer" parent="."]
4747

ui/viewmodels/vm_carbon.gd renamed to ui/viewmodels/vm_global_carbon.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extends ViewModelBase
2-
class_name CarbonViewModel
2+
class_name GlobalCarbonViewModel
33

44
signal on_carbon_in_atmosphere_changed (new_carbon_level_ppm: float)
55

ui/viewmodels/vm_registry.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
extends Node
22
class_name ViewModelRegistry
33

4-
enum Keys { TIMER, COUNTRIES, TEMPERATURE, GAME_MODE, CARBON }
4+
enum Keys { TIMER, COUNTRIES, TEMPERATURE, GAME_MODE, GLOBAL_CARBON }
55
static var registry = {}
66

77
static func register(key: Keys, view_model: ViewModelBase):

ui/widgets/top_app_bar.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func _ready() -> void:
1919
if temperature_view_model:
2020
temperature_view_model.on_temperature_anomaly_changed.connect(_on_temperature_anomaly_changed)
2121

22-
var carbon_view_model = ViewModelRegistry.retrieve(ViewModelRegistry.Keys.CARBON) as CarbonViewModel
22+
var carbon_view_model = ViewModelRegistry.retrieve(ViewModelRegistry.Keys.GLOBAL_CARBON) as GlobalCarbonViewModel
2323
if carbon_view_model:
2424
carbon_view_model.on_carbon_in_atmosphere_changed.connect(_handle_carbon_atmosphere_changed)
2525

0 commit comments

Comments
 (0)