public void Update(GamePlayerModel model)
        {
            stage       = model.stage;
            status      = model.status;
            chairIndex  = model.chairIndex;
            card1       = model.card1;
            card2       = model.card2;
            orderNo     = model.orderNo;
            buyInLeft   = model.buyInLeft;
            lastBetType = model.lastBetType;
            betCount    = model.betCount;
            lastBet     = model.lastBet;
            lastCall    = model.lastCall;
            lastRaise   = model.lastRaise;
            stageBet    = model.stageBet;
            totalBet    = model.totalBet;

            result = model.result;

            userIndex = model.userIndex;
            coin      = model.coin;
            nickName  = model.nickName;
            isMyTurn  = model.isMyTurn;

            roomStage = model.roomStage;
            roomState = model.roomState;
            isWinner  = model.isWinner;
        }
        public void SetGamePlayer(GamePlayer gamePlayer, Room room)
        {
            stage       = gamePlayer.stage;
            status      = (GamePlayerState)gamePlayer.state;
            chairIndex  = gamePlayer.chairIndex;
            card1       = gamePlayer.card1;
            card2       = gamePlayer.card2;
            orderNo     = gamePlayer.orderNo;
            buyInLeft   = gamePlayer.buyInLeft;
            lastBetType = (BetType)gamePlayer.lastBetType;
            betCount    = gamePlayer.betCount;
            lastBet     = gamePlayer.lastBet;
            lastCall    = gamePlayer.lastCall;
            lastRaise   = gamePlayer.lastRaise;
            stageBet    = gamePlayer.stageBet;
            totalBet    = gamePlayer.totalBet;

            userIndex = gamePlayer.userIndex;
            coin      = gamePlayer.coin;
            nickName  = gamePlayer.nickName;
            result    = gamePlayer.result;

            isMyTurn = gamePlayer.userIndex == room.currentUserIndex && roomStage % 3 == 0;

            betCount  = room.betCount;
            roomStage = room.stage;
            isWinner  = room.winnerUserIndex == gamePlayer.userIndex;
            roomState = (int)room.state;
        }
Example #3
0
 public GamePlayer(PlayerIDType id, GamePlayerState state, TeamIDType team, ushort scenarioID, bool isAI, bool isHumanTurnedIntoAI, bool hasCommittedOrders)
 {
     this.ID                 = id;
     this.State              = state;
     this.Team               = team;
     this.ScenarioID         = scenarioID;
     this.IsAI               = isAI;
     this.HumanTurnedIntoAI  = isHumanTurnedIntoAI;
     this.HasCommittedOrders = hasCommittedOrders;
 }
Example #4
0
    //========================================================================
    //  private funcs
    //Initialize Components Value
    void initializeComponents()
    {
        animator = gameObject.GetComponent <Animator>();
        if (!animator)
        {
            print("there isn't Animator"); return;
        }

        rigid = gameObject.GetComponent <Rigidbody2D>();
        if (!rigid)
        {
            print("There isn't rigid_2d"); return;
        }

        stat = gameObject.GetComponent <GamePlayerStat>();
        if (!stat)
        {
            print("There isn't Game Player Stat"); return;
        }

        state = gameObject.GetComponent <GamePlayerState>();
        if (!state)
        {
            print("Thee isn't Game Player State"); return;
        }

        collision = gameObject.GetComponent <BoxCollider2D>();
        if (!collision)
        {
            print("There isn't BoxCollider2D"); return;
        }
        mag = gameObject.GetComponent <Mag>();
        if (!mag)
        {
            print("There isn't mag"); return;
        }
    }