Skip to content
Merged
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
20 changes: 19 additions & 1 deletion src/interfaces/IWorld.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use dojo_starter::model::game_model::{GameMode, Game};
use dojo_starter::model::player_model::{PlayerSymbol, Player};
use dojo_starter::model::property_model::{Property};

use core::array::Array;
use starknet::{ContractAddress};

// define the interface
Expand Down Expand Up @@ -50,4 +50,22 @@ pub trait IWorld<T> {
fn sell_house_or_hotel(ref self: T, property_id: u8, game_id: u256) -> bool;
fn mint(ref self: T, recepient: ContractAddress, game_id: u256, amount: u256);
fn get_players_balance(ref self: T, player: ContractAddress, game_id: u256) -> u256;

fn get_properties_owned_by_player(
ref self: T, player: ContractAddress, game_id: u256,
) -> Array<u8>;
fn get_properties_by_group(ref self: T, group_id: u8, game_id: u256) -> Array<u8>;
fn has_monopoly(ref self: T, player: ContractAddress, group_id: u8, game_id: u256) -> bool;
fn collect_rent_with_monopoly(ref self: T, property_id: u8, game_id: u256) -> bool;
fn get_property_value(ref self: T, property_id: u8, game_id: u256) -> u256;
fn can_develop_property(ref self: T, property_id: u8, game_id: u256) -> bool;
fn can_develop_evenly(
ref self: T, property_id: u8, group_id: u8, game_id: u256, is_building: bool,
) -> bool;
fn can_sell_development(ref self: T, property_id: u8, game_id: u256) -> bool;
fn batch_generate_properties(
ref self: T,
game_id: u256,
properties: Array<(u8, felt252, u256, u256, u256, u256, u256, u256, u256, u256, u8)>,
);
}
5 changes: 5 additions & 0 deletions src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ pub mod model {
pub mod tests {
mod test_world;
mod test_player_model;
mod test_property_enhanced;
}

pub mod utils {
pub mod property_templates;
}
Loading
Loading