-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rc 1 #1851
base: main
Are you sure you want to change the base?
Rc 1 #1851
Changes from 54 commits
1cc8ae7
2a9d74f
2de3144
643adfe
7071408
bb455dc
8bf1719
6801555
0863069
3114173
81dcb2f
b1399f5
ac53635
4df7593
9caaa22
98ca85a
18c265b
1216d97
6cdd454
95c1ffe
44189da
da9095c
906b7ae
aa2e6b8
7b8a269
cff9d59
a4259e4
32b2ce0
616a06f
ef1e3fe
cbc538d
963dd7d
8d05f50
4f571d5
4dc6fe3
4b1634f
3d22735
b216174
ad9b156
abe2e34
734981b
94ba145
44c2368
0a2fab3
841da49
c99cbdc
ca54d5e
fc32c71
07e63ac
96bf29a
6538de4
f26eaa8
364e7aa
d3bd7cb
43456ea
5c0bf58
0e25f47
29f4920
bc98bc6
51fddb3
78a9a12
34a4a72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -551,12 +551,18 @@ export function defineContractComponents(world: World) { | |
HyperstructureConfig: (() => { | ||
return defineComponent( | ||
world, | ||
{ config_id: RecsType.Number, time_between_shares_change: RecsType.Number }, | ||
{ | ||
config_id: RecsType.Number, | ||
time_between_shares_change: RecsType.Number, | ||
points_per_cycle: RecsType.BigInt, | ||
points_for_win: RecsType.BigInt, | ||
points_on_completion: RecsType.BigInt, | ||
}, | ||
{ | ||
metadata: { | ||
namespace: "eternum", | ||
name: "HyperstructureConfig", | ||
types: ["u32", "u64"], | ||
types: ["u32", "u64", "u128", "u128", "u128"], | ||
customTypes: [], | ||
}, | ||
}, | ||
|
@@ -976,6 +982,34 @@ export function defineContractComponents(world: World) { | |
}, | ||
); | ||
})(), | ||
RealmLevelConfig: (() => { | ||
return defineComponent( | ||
world, | ||
{ level: RecsType.Number, required_resources_id: RecsType.Number, required_resource_count: RecsType.Number }, | ||
{ | ||
metadata: { | ||
namespace: "eternum", | ||
name: "RealmLevelConfig", | ||
types: ["u8", "u32", "u8"], | ||
customTypes: [], | ||
}, | ||
}, | ||
); | ||
})(), | ||
RealmMaxLevelConfig: (() => { | ||
return defineComponent( | ||
world, | ||
{ config_id: RecsType.Number, max_level: RecsType.Number }, | ||
{ | ||
metadata: { | ||
namespace: "eternum", | ||
name: "RealmMaxLevelConfig", | ||
types: ["u32", "u8"], | ||
customTypes: [], | ||
}, | ||
}, | ||
); | ||
})(), | ||
Comment on lines
+999
to
+1012
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion New component The For example, since |
||
Resource: (() => { | ||
return defineComponent( | ||
world, | ||
|
@@ -1201,6 +1235,27 @@ export function defineContractComponents(world: World) { | |
}, | ||
); | ||
})(), | ||
TravelFoodCostConfig: (() => { | ||
return defineComponent( | ||
world, | ||
{ | ||
config_id: RecsType.Number, | ||
unit_type: RecsType.Number, | ||
explore_wheat_burn_amount: RecsType.BigInt, | ||
explore_fish_burn_amount: RecsType.BigInt, | ||
travel_wheat_burn_amount: RecsType.BigInt, | ||
travel_fish_burn_amount: RecsType.BigInt, | ||
}, | ||
{ | ||
metadata: { | ||
namespace: "eternum", | ||
name: "TravelFoodCostConfig", | ||
types: ["u32", "u8", "u128", "u128", "u128", "u128"], | ||
customTypes: [], | ||
}, | ||
}, | ||
); | ||
})(), | ||
TravelStaminaCostConfig: (() => { | ||
return defineComponent( | ||
world, | ||
|
@@ -1230,6 +1285,7 @@ export function defineContractComponents(world: World) { | |
crossbowman_strength: RecsType.Number, | ||
advantage_percent: RecsType.Number, | ||
disadvantage_percent: RecsType.Number, | ||
max_troop_count: RecsType.Number, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Inconsistent Usage of The property
🔗 Analysis chainAddition of The new property Run the following script to verify that all usages of 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify that all usages of `TroopConfig` include `max_troop_count`
# Test: Search for definitions and usages of `TroopConfig` and check for `max_troop_count` property
# Expect: All instances of `TroopConfig` should include `max_troop_count`
rg --type ts 'TroopConfig' -A 15 | rg 'max_troop_count'
Length of output: 406 |
||
pillage_health_divisor: RecsType.Number, | ||
army_free_per_structure: RecsType.Number, | ||
army_extra_per_building: RecsType.Number, | ||
|
@@ -1242,7 +1298,7 @@ export function defineContractComponents(world: World) { | |
metadata: { | ||
namespace: "eternum", | ||
name: "TroopConfig", | ||
types: ["u32", "u32", "u8", "u8", "u16", "u16", "u16", "u8", "u8", "u8", "u8", "u8", "u8", "u16"], | ||
types: ["u32", "u32", "u8", "u8", "u16", "u16", "u16", "u64", "u8", "u8", "u8", "u8", "u8", "u8", "u16"], | ||
customTypes: [], | ||
}, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
New component
RealmLevelConfig
added correctlyThe
RealmLevelConfig
component has been introduced with appropriate properties and matching metadata. However, consider specifying more explicitRecsType
types to enhance clarity and ensure type safety.For instance, since
level
corresponds to"u8"
in the metadata, you could useRecsType.Number8
if available. This approach can help prevent potential type mismatches and improve code readability.