[][src]Trait codegame::Game

pub trait Game: Diff + Schematic {
    type Options: Serialize + for<'de> Deserialize<'de> + Sync + Send + Clone + 'static;
    type OptionsPreset: Serialize + for<'de> Deserialize<'de> + Sync + Send + Clone + 'static + Into<Self::Options>;
    type PlayerOptions: PlayerOptions<Self> + Serialize + for<'de> Deserialize<'de> + Sync + Send + Clone + 'static;
    type Action: Serialize + for<'de> Deserialize<'de> + Trans + Schematic + Sync + Send + Clone + 'static;
    type Event: Serialize + for<'de> Deserialize<'de> + Trans + Schematic + Sync + Send + Clone + 'static;
    type PlayerView: Serialize + for<'de> Deserialize<'de> + Trans + Schematic + Sync + Send + Clone + 'static;
    type Results: Serialize + for<'de> Deserialize<'de> + Sync + Send + Clone + 'static;
    type PlayerExtraData;
    type CustomData: Serialize + for<'de> Deserialize<'de> + Trans + Schematic + Sync + Send + Clone + 'static;
    fn init(
        rng: &mut dyn RngCore,
        player_count: usize,
        options: Self::Options
    ) -> Self;
fn player_view(&self, player_index: usize) -> Self::PlayerView;
fn process_turn(
        &mut self,
        rng: &mut dyn RngCore,
        actions: HashMap<usize, Self::Action>
    ) -> Vec<Self::Event>

Important traits for Vec<u8>

impl Write for Vec<u8>
;
fn finished(&self) -> bool;
fn results(&self) -> Self::Results; }

Associated Types

type Options: Serialize + for<'de> Deserialize<'de> + Sync + Send + Clone + 'static

type OptionsPreset: Serialize + for<'de> Deserialize<'de> + Sync + Send + Clone + 'static + Into<Self::Options>

type PlayerOptions: PlayerOptions<Self> + Serialize + for<'de> Deserialize<'de> + Sync + Send + Clone + 'static

type Action: Serialize + for<'de> Deserialize<'de> + Trans + Schematic + Sync + Send + Clone + 'static

type Event: Serialize + for<'de> Deserialize<'de> + Trans + Schematic + Sync + Send + Clone + 'static

type PlayerView: Serialize + for<'de> Deserialize<'de> + Trans + Schematic + Sync + Send + Clone + 'static

type Results: Serialize + for<'de> Deserialize<'de> + Sync + Send + Clone + 'static

type PlayerExtraData

type CustomData: Serialize + for<'de> Deserialize<'de> + Trans + Schematic + Sync + Send + Clone + 'static

Loading content...

Required methods

fn init(
    rng: &mut dyn RngCore,
    player_count: usize,
    options: Self::Options
) -> Self

fn player_view(&self, player_index: usize) -> Self::PlayerView

fn process_turn(
    &mut self,
    rng: &mut dyn RngCore,
    actions: HashMap<usize, Self::Action>
) -> Vec<Self::Event>

Important traits for Vec<u8>

impl Write for Vec<u8>

fn finished(&self) -> bool

fn results(&self) -> Self::Results

Loading content...

Implementors

Loading content...