diff --git a/src/models/data/reward.cairo b/src/models/data/reward.cairo index 254f7a8..5261706 100644 --- a/src/models/data/reward.cairo +++ b/src/models/data/reward.cairo @@ -17,6 +17,7 @@ enum RewardType { SPECIAL_CARDS, NONE } + #[generate_trait] impl RewardImpl of RewardTrait { fn challenge(world: IWorldDispatcher, game_id: u32) { diff --git a/src/systems/player_system.cairo b/src/systems/player_system.cairo index d33f7c4..7685664 100644 --- a/src/systems/player_system.cairo +++ b/src/systems/player_system.cairo @@ -1,24 +1,45 @@ -use jokers_of_neon::models::{ - status::{game::game::{Game, GameStore}, round::current_hand_card::{CurrentHandCard, CurrentHandCardTrait}} +use jokers_of_neon::{ + models::{ + data::{beast::{GameModeBeast, Beast, PlayerBeast}, challenge::{Challenge, ChallengePlayer}, reward::Reward,}, + status::{game::game::Game, shop::shop::BlisterPackResult, round::current_hand_card::CurrentHandCard} + } }; #[dojo::interface] trait IPlayerSystem { - fn get_player_current_hand(world: @IWorldDispatcher, game_id: u32) -> Array; fn get_game(world: @IWorldDispatcher, game_id: u32) -> Game; + fn get_player_current_hand(world: @IWorldDispatcher, game_id: u32) -> Array; + fn get_game_mode_beast(world: @IWorldDispatcher, game_id: u32) -> GameModeBeast; + fn get_beast(world: @IWorldDispatcher, game_id: u32) -> Beast; + fn get_player_beast(world: @IWorldDispatcher, game_id: u32) -> PlayerBeast; + fn get_challenge(world: @IWorldDispatcher, game_id: u32) -> Challenge; + fn get_challenge_player(world: @IWorldDispatcher, game_id: u32) -> ChallengePlayer; + fn get_reward(world: @IWorldDispatcher, game_id: u32) -> Reward; + fn get_blister_pack_result(world: @IWorldDispatcher, game_id: u32) -> BlisterPackResult; } #[dojo::contract] mod player_system { use jokers_of_neon::{ - store::StoreTrait, models::{ - status::{game::game::{Game, GameStore}, round::current_hand_card::{CurrentHandCard, CurrentHandCardStore}} + data::{ + beast::{Beast, BeastStore, GameModeBeast, GameModeBeastStore, PlayerBeast, PlayerBeastStore}, + challenge::{Challenge, ChallengeStore, ChallengePlayer, ChallengePlayerStore}, + reward::{Reward, RewardStore}, + }, + status::{ + game::game::{Game, GameStore}, shop::shop::{BlisterPackResult, BlisterPackResultStore}, + round::current_hand_card::{CurrentHandCard, CurrentHandCardStore} + } } }; #[abi(embed_v0)] impl PokerHandSystem of super::IPlayerSystem { + fn get_game(world: @IWorldDispatcher, game_id: u32) -> Game { + GameStore::get(world, game_id) + } + fn get_player_current_hand(world: @IWorldDispatcher, game_id: u32) -> Array { let mut current_hand = array![]; let game = GameStore::get(world, game_id); @@ -34,8 +55,32 @@ mod player_system { current_hand } - fn get_game(world: @IWorldDispatcher, game_id: u32) -> Game { - GameStore::get(world, game_id) + fn get_beast(world: @IWorldDispatcher, game_id: u32) -> Beast { + BeastStore::get(world, game_id) + } + + fn get_player_beast(world: @IWorldDispatcher, game_id: u32) -> PlayerBeast { + PlayerBeastStore::get(world, game_id) + } + + fn get_game_mode_beast(world: @IWorldDispatcher, game_id: u32) -> GameModeBeast { + GameModeBeastStore::get(world, game_id) + } + + fn get_challenge(world: @IWorldDispatcher, game_id: u32) -> Challenge { + ChallengeStore::get(world, game_id) + } + + fn get_challenge_player(world: @IWorldDispatcher, game_id: u32) -> ChallengePlayer { + ChallengePlayerStore::get(world, game_id) + } + + fn get_reward(world: @IWorldDispatcher, game_id: u32) -> Reward { + RewardStore::get(world, game_id) + } + + fn get_blister_pack_result(world: @IWorldDispatcher, game_id: u32) -> BlisterPackResult { + BlisterPackResultStore::get(world, game_id) } } }