-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(contracts): move location spawn into create game
- Loading branch information
Showing
9 changed files
with
110 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,29 @@ | ||
#[derive(Component, Copy, Drop, Serde)] | ||
struct Location { | ||
id: u32, | ||
id: u8, | ||
} | ||
|
||
#[derive(Serde, Copy, Drop)] | ||
enum LocationId { | ||
None: (), | ||
Bronx: (), | ||
Queens: (), | ||
Brooklyn: (), | ||
JerseyCity: (), | ||
CentralPark: (), | ||
ConeyIsland: (), | ||
} | ||
|
||
impl LocationIdIntoU8 of Into<LocationId, u8> { | ||
fn into(self: LocationId) -> u8 { | ||
match self { | ||
LocationId::None(()) => 0, | ||
LocationId::Bronx(()) => 1, | ||
LocationId::Queens(()) => 2, | ||
LocationId::Brooklyn(()) => 3, | ||
LocationId::JerseyCity(()) => 4, | ||
LocationId::CentralPark(()) => 5, | ||
LocationId::ConeyIsland(()) => 6, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
const BALANCE_UPPER_BOUND: felt252 = 0x10000000000000000; | ||
const SCALING_FACTOR: u128 = 10000; | ||
const SCALING_FACTOR: u128 = 10000; | ||
|
||
const MAX_LOCATIONS: u8 = 6; | ||
const MAX_PRODUCTS: u8 = 6; | ||
|
||
const TRAVEL_RISK: u8 = 30; | ||
const HURT_RISK: u8 = 30; | ||
const MUGGED_RISK: u8 = 30; | ||
const ARRESTED_RISK: u8 = 10; | ||
|
||
const MARKET_QUANTITY: usize = 1000; | ||
const MARKET_CASH: u128 = 1000000; // 100USD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.