Closed edisontim closed 3 months ago
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
eternum | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Jun 14, 2024 7:37pm |
โฑ๏ธ Estimated effort to review [1-5] | 4 |
๐งช Relevant tests | No |
๐ Security concerns | No |
โก Key issues to review |
Possible Bug: The `battleActive` method in `BattleManager.ts` now uses `currentTick` to calculate `timeSinceLastUpdate`, but it's unclear how `getElapsedTime` is implemented. This could potentially lead to incorrect calculations if not handled properly. |
Refactoring Concern: The `useBattlesByPosition` function in `useBattles.tsx` now directly checks for ongoing battles by comparing health values, which might not account for other conditions that could affect battle status. | |
Data Structure Changes: The removal of `name` from `FullStructure` and addition of `protector` in `Realm` in `useStructures.tsx` could lead to issues where other parts of the codebase expect the `name` property to exist or do not handle the new `protector` property correctly. | |
Consistency Issue: The `BattleViewInfo` type in `types.ts` has been modified to use `Realm` or `Structure` instead of `FullStructure`, which could lead to inconsistencies in how battle information is processed and displayed across different components. |
Failed to generate code suggestions for PR
PR Type
Enhancement, Bug fix
Description
battleActive
method inBattleManager
to usecurrentTick
.useBattlesByPosition
.Realm
andFullStructure
types, removingname
fromFullStructure
and addingprotector
toRealm
.Realm
andStructure
.OngoingBattle
andNoOngoingBattle
for better battle state management.Changes walkthrough ๐
17 files
BattleManager.ts
Update battleActive method to use current tick
client/src/dojo/modelManager/BattleManager.ts
battleActive
method to acceptcurrentTick
parameter.time.
useBattles.tsx
Add ongoing battle check in useBattlesByPosition
client/src/hooks/helpers/useBattles.tsx - Added check for ongoing battle based on army health.
useStructures.tsx
Update Realm and FullStructure types
client/src/hooks/helpers/useStructures.tsx
Realm
andFullStructure
types.name
fromFullStructure
.protector
toRealm
.types.ts
Update BattleViewInfo type to use new structures
client/src/hooks/store/types.ts - Updated `BattleViewInfo` type to use `Realm` and `Structure`.
useUIStore.tsx
Update setBattleView method for new structures
client/src/hooks/store/useUIStore.tsx - Updated `setBattleView` method to use `Realm` and `Structure`.
StructureCard.tsx
Update combat button logic in StructureCard
client/src/ui/components/hyperstructures/StructureCard.tsx - Updated combat button logic to use `Realm` and `Structure`.
ArmyChip.tsx
Add conditional check for army health display
client/src/ui/components/military/ArmyChip.tsx - Added conditional check for army health display.
BattleLabel.tsx
Update onClick logic in BattleLabel
client/src/ui/components/worldmap/armies/BattleLabel.tsx - Updated `onClick` logic to handle `Realm` and `Structure`.
HexagonInformationPanel.tsx
Add conditional check for displaying enemies
client/src/ui/components/worldmap/hexagon/HexagonInformationPanel.tsx - Added conditional check for displaying enemies.
BattleActions.tsx
Refactor battle action handlers for new structures
client/src/ui/modules/military/battle-view/BattleActions.tsx
Realm
andStructure
.BattleProgressBar.tsx
Update health display logic in BattleProgressBar
client/src/ui/modules/military/battle-view/BattleProgressBar.tsx - Updated health display logic.
BattleView.tsx
Refactor BattleView to use new components
client/src/ui/modules/military/battle-view/BattleView.tsx
OngoingBattle
andNoOngoingBattle
components.Realm
andStructure
.EntityAvatar.tsx
Update EntityAvatar to use new structures
client/src/ui/modules/military/battle-view/EntityAvatar.tsx - Updated to use `Realm` and `Structure`.
NoOngoingBattle.tsx
Add NoOngoingBattle component
client/src/ui/modules/military/battle-view/NoOngoingBattle.tsx - Added new component for handling no ongoing battle state.
OngoingBattle.tsx
Add OngoingBattle component
client/src/ui/modules/military/battle-view/OngoingBattle.tsx - Added new component for handling ongoing battle state.
Troops.tsx
Update no defending army message
client/src/ui/modules/military/battle-view/Troops.tsx - Updated message for no defending army.
contracts.cairo
Add entity_id to battle_position in combat system
contracts/src/systems/combat/contracts.cairo - Added `entity_id` to `battle_position`.
1 files
Battle.tsx
Remove console log from Battle component
client/src/ui/components/military/Battle.tsx - Removed unnecessary console log.
3 files
EntitiesArmyTable.tsx
Add spacing in EntitiesArmyTable for readability
client/src/ui/components/military/EntitiesArmyTable.tsx - Added spacing for better readability.
TopMiddleNavigation.tsx
Reorganize imports in TopMiddleNavigation
client/src/ui/modules/navigation/TopMiddleNavigation.tsx - Reorganized imports for better readability.
index.ts
Reorganize imports in provider index
sdk/packages/eternum/src/provider/index.ts - Reorganized imports for better readability.
2 files
manifest.json
Update manifest with new block number and class hashes
contracts/manifests/dev/manifest.json - Updated block number and class hashes. - Removed loyalty model.
manifest.toml
Update manifest with new block number and class hashes
contracts/manifests/dev/manifest.toml - Updated block number and class hashes. - Removed loyalty model.