[][src]Struct mem6::gamedatamod::GameData

pub struct GameData {
    pub my_ws_uid: usize,
    pub my_nickname: String,
    pub my_player_number: usize,
    pub ws: WebSocket,
    pub players: Vec<Player>,
    pub players_ws_uid: String,
    pub game_status: GameStatus,
    pub card_grid_data: Vec<Card>,
    pub card_index_of_first_click: usize,
    pub card_index_of_second_click: usize,
    pub game_name: String,
    pub player_turn: usize,
    pub content_folders: Vec<String>,
    pub games_metadata: Option<GamesMetadata>,
    pub game_config: Option<GameConfig>,
    pub error_text: String,
    pub href: String,
    pub href_hash: String,
    pub is_reconnect: bool,
    pub msgs_waiting_ack: Vec<MsgInQueue>,
    pub show_debug_info: bool,
}

game data

Fields

my_ws_uid: usize

my ws client instance unique id. To not listen the echo to yourself.

my_nickname: String

my nickname

my_player_number: usize

What player am I

ws: WebSocket

web socket. used it to send message onclick.

players: Vec<Player>

players data as vector of player struct

players_ws_uid: String

the json string for the ws server to send msgs to other players only

game_status: GameStatus

game status: StatusStartPage,Player1,Player2

card_grid_data: Vec<Card>

vector of cards

card_index_of_first_click: usize

card index of first click

card_index_of_second_click: usize

card index of second click

game_name: String

content folder name

player_turn: usize

whose turn is now: player 1,2,3,...

content_folders: Vec<String>

content folders vector

games_metadata: Option<GamesMetadata>

games meta data

game_config: Option<GameConfig>

game_configs

error_text: String

error text

href: String

href

href_hash: String

href hash the local page #

is_reconnect: bool

is reconnect

msgs_waiting_ack: Vec<MsgInQueue>

vector of msgs waiting for ack. If the 3 sec timeout passes it resends the same msg.

show_debug_info: bool

show debug info on the smartphone screen

Methods

impl GameData[src]

pub fn prepare_random_data(&mut self)[src]

prepare new random data

pub fn prepare_for_empty() -> Vec<Card>[src]

associated function: before join, there are not random numbers, just default cards.

pub fn new(ws: WebSocket, my_ws_uid: usize) -> Self[src]

constructor of game data

Auto Trait Implementations

impl RefUnwindSafe for GameData

impl !Send for GameData

impl !Sync for GameData

impl Unpin for GameData

impl UnwindSafe for GameData

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
    Scheme: ApproxScheme, 

type Err = NoError

The error type produced by a failed conversion.

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
    Dst: ApproxFrom<Src, Scheme>,
    Scheme: ApproxScheme, 

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, Dst> ConvAsUtil<Dst> for T

impl<T> ConvUtil for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Src> TryFrom<Src> for Src

type Err = NoError

The error type produced by a failed conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<Src, Dst> TryInto<Dst> for Src where
    Dst: TryFrom<Src>, 

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<Src> ValueFrom<Src> for Src

type Err = NoError

The error type produced by a failed conversion.

impl<Src, Dst> ValueInto<Dst> for Src where
    Dst: ValueFrom<Src>, 

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.