コード例 #1
0
    void Awake()
    {
        ++mTurnCount;

        mActivePlayer  = PLAYER_ID.ONE;
        mGamePhase     = GAME_PHASE.MANA_PHASE;
        mActveManazone = mManazone_One;
        mActiveDeck    = mDeck_One;
        mActiveHand    = mHand_One;

        mHand_One.SetDeck(mDeck_One);
        mHand_Two.SetDeck(mDeck_Two);
        mDeck_One.SetOwner(PLAYER_ID.ONE);
        mDeck_Two.SetOwner(PLAYER_ID.TWO);
        mShieldzone_One.SetDeck(mDeck_One);

        mBattlezone_One.SetOwner(PLAYER_ID.ONE);
        mBattlezone_Two.SetOwner(PLAYER_ID.TWO);

        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
コード例 #2
0
    public void EndTurn()
    {
        mActivePlayer = mActivePlayer == PLAYER_ID.ONE ? PLAYER_ID.TWO : PLAYER_ID.ONE;
        ChangeUI();
        if (mActivePlayer == PLAYER_ID.ONE)
        {
            mZoneList         = mZoneList_P1;
            mActveManazone    = mManazone_One;
            mActiveDeck       = mDeck_One;
            mActiveBattlezone = mBattlezone_One;
            mActiveHand       = mHand_One;
        }
        else
        {
            mZoneList         = mZoneList_P2;
            mActveManazone    = mManazone_Two;
            mActiveDeck       = mDeck_Two;
            mActiveBattlezone = mBattlezone_Two;
            mActiveHand       = mHand_Two;
        }

        mActiveHand.Draw();
        mActveManazone.NewTurn();
        mActiveBattlezone.NewTurn();
        mGamePhase = GAME_PHASE.MANA_PHASE;
    }
コード例 #3
0
ファイル: Main.cs プロジェクト: clancy1066/SaladChef
    void UpdateUI()
    {
        if (m_scoreKeeper == null)
        {
            return;
        }

        if (m_isTwoPlayerGame)
        {
            for (PLAYER_ID iter = PLAYER_ID.PLAYER1; iter < PLAYER_ID.MAX; iter++)
            {
                Player player = (m_playersMap.ContainsKey(iter) ? m_playersMap[iter] : null);

                if (player != null)
                {
                    m_scoreKeeper.SetScore(iter, player.GetVitals());
                }
            }
        }
        else
        {
            Player player = (m_playersMap.ContainsKey(PLAYER_ID.PLAYER1) ? m_playersMap[PLAYER_ID.PLAYER1] : null);

            if (player != null)
            {
                m_scoreKeeper.SetScore(PLAYER_ID.PLAYER1, player.GetVitals());
            }
        }
    }
コード例 #4
0
 public PlayerInputMessage(SEND_TYPE t, PLAYER_ID id, int hInput, int vInput)
     : base(DATAMESSAGE_TYPE.PLAYER_INPUT, t)
 {
     horzInput = hInput;
     vertInput = vInput;
     ID        = id;
 }
コード例 #5
0
 public PlayerUpdateMessage(SEND_TYPE t, PLAYER_ID id, float xPos, float yPos, float angle)
     : base(DATAMESSAGE_TYPE.PLAYER_UPDATE, t)
 {
     x      = xPos;
     y      = yPos;
     pAngle = angle;
     ID     = id;
 }
コード例 #6
0
 public MissileUpdateMessage(SEND_TYPE t, PLAYER_ID id, int networkID, float xPos, float yPos, int last)
     : base(DATAMESSAGE_TYPE.MISSILE_UPDATE, t)
 {
     ID = id;
     missileNetworkID = networkID;
     x      = xPos;
     y      = yPos;
     lastID = last;
 }
コード例 #7
0
ファイル: Main.cs プロジェクト: clancy1066/SaladChef
    // *************************************************
    // Player Manipulations
    // ************************************************
    void ChangePlayerName(PLAYER_ID playerID, string newName)
    {
        Player player = (m_playersMap.ContainsKey(playerID) ? m_playersMap[playerID] : null);

        if (player != null)
        {
            PLAYER_VITALS vitals = player.GetVitals();

            vitals.m_name = newName;
        }
    }
コード例 #8
0
ファイル: ScoreKeeper.cs プロジェクト: clancy1066/SaladChef
    public void SetName(PLAYER_ID playerID, string newName)
    {
        if (m_playerScores == null)
        {
            return;
        }

        int index = (int)playerID - 1;

        if (index < m_playerScores.Length)
        {
            m_playerScores[index].SetName(newName);
        }
    }
コード例 #9
0
ファイル: ScoreKeeper.cs プロジェクト: clancy1066/SaladChef
    public void SetScore(PLAYER_ID playerID, PLAYER_VITALS vitals)
    {
        if (m_playerScores == null)
        {
            return;
        }

        int index = (int)playerID - 1;

        if (index < m_playerScores.Length)
        {
            m_playerScores[index].Set(vitals);
        }
    }
コード例 #10
0
ファイル: Waiter.cs プロジェクト: clancy1066/SaladChef
    static public int SubmitPlate(PLAYER_ID playerID, uint ingredientMask)
    {
        foreach (Customer customer in sm_waitingCustomers)
        {
            if (customer.OrderFullFilled(ingredientMask))
            {
                customer.SetSubmittingPlayer(playerID);


                OrderSatisfied(customer);

                return(customer.GetOrderCost());
            }
        }



        return(-1);
    }
コード例 #11
0
        public Missile(Azul.Rect destRect, int ownerIDNum, PLAYER_ID owner, Vec2 direction, Azul.Color color)
            : base(GAMEOBJECT_TYPE.MISSILE, new Azul.Rect(0, 0, 24, 6), destRect, GameObject.missileTexture, color)
        {
            //PhysicBody_Data data = new PhysicBody_Data();

            //data.position = new Vec2(destRect.x, destRect.y);
            //data.size = new Vec2(destRect.width, destRect.height);
            //data.radius = 25f;
            //data.isSensor = true;
            //data.angle = 0;
            //data.shape_type = PHYSICBODY_SHAPE_TYPE.DYNAMIC_BOX;

            ownerID  = ownerIDNum;
            MaxForce = 1000f;
            pOwner   = owner;

            //CreatePhysicBody(data);

            LaunchAt(direction);
        }
コード例 #12
0
ファイル: Customer.cs プロジェクト: clancy1066/SaladChef
 public void SetSubmittingPlayer(PLAYER_ID newID)
 {
     m_submittingPlayer = newID;
 }
コード例 #13
0
 public void SetOwner(PLAYER_ID _owner)
 {
     mPlayerOwner = _owner;
 }
コード例 #14
0
 public void Set(PLAYER_ID newID, int newValue, float timeBonus = 0.0f)
 {
     m_playerID  = newID;
     m_value     = newValue;
     m_timeBonus = timeBonus;
 }
コード例 #15
0
ファイル: Card.cs プロジェクト: Chunchunmarx/Duel-Masters
 public void TestSetOwner()
 {
     mPlayerOwner = PLAYER_ID.TWO;
 }
コード例 #16
0
 public CreateMissileMessage(SEND_TYPE t, PLAYER_ID id, int uniqueMissileID)
     : base(DATAMESSAGE_TYPE.MISSILE_CREATE, t)
 {
     ID = id;
     missileNetworkID = uniqueMissileID;
 }
コード例 #17
0
 public RemoveMissileMessage(SEND_TYPE t, PLAYER_ID id, int uniqueMissileID)
     : base(DATAMESSAGE_TYPE.MISSILE_REMOVE, t)
 {
     ID = id;
     missileNetworkID = uniqueMissileID;
 }