Beispiel #1
0
    public void UpdateInfo(ObscuredPlayerInfoMessage msg)
    {
        drawPileCount    = msg.drawPileCount;
        discardPileCount = msg.discardPileCount;
        handCount        = msg.handCount;

        attackCardCount  = msg.attackCount;
        defenseCardCount = msg.defenseCount;
        bonusCards       = Extensions.ParseStringIntoIntArray(msg.bonus, 3);
        hasAce           = msg.hasAce;
    }
Beispiel #2
0
    public OtherPlayer(ObscuredPlayerInfoMessage msg)
    {
        connectionID     = msg.connID;
        drawPileCount    = msg.drawPileCount;
        discardPileCount = msg.discardPileCount;
        handCount        = msg.handCount;

        attackCardCount  = msg.attackCount;
        defenseCardCount = msg.defenseCount;
        bonusCards       = Extensions.ParseStringIntoIntArray(msg.bonus, 3);
        playerName       = msg.playerName;
        hasAce           = msg.hasAce;
    }
Beispiel #3
0
    public ObscuredPlayerInfoMessage GetObscurePlayerInfo(int playerID)
    {
        var obscuredInfo = new ObscuredPlayerInfoMessage();
        var player       = gameManager.players[playerID];

        obscuredInfo.attackCount      = GetAmountCardsOnField(player.attackField);
        obscuredInfo.defenseCount     = GetAmountCardsOnField(player.defenseField);
        obscuredInfo.bonus            = GetBonusCardsAsString(player.bonusField);
        obscuredInfo.handCount        = player.hand.Count;
        obscuredInfo.drawPileCount    = player.drawPile.Count;
        obscuredInfo.discardPileCount = player.discardPile.Count;
        obscuredInfo.playerName       = player.playerName;
        obscuredInfo.hasAce           = player.hasAce;
        obscuredInfo.connID           = player.connectionID;

        return(obscuredInfo);
    }
Beispiel #4
0
    public void ProcessPlayer(ObscuredPlayerInfoMessage msg)
    {
        //int id = msg.connID - 1;
        var enemy = GetEnemyByName(msg.playerName);

        if (enemy != null)
        {
            enemy.UpdateInfo(msg);
        }
        else
        {
            enemies.Add(new OtherPlayer(msg));
        }

        //If we just updated the enemy that we're currently displaying on the screen, refresh it
        if (enemies[currentEnemyID].playerName == msg.playerName)
        {
            DisplayEnemy(currentEnemyID);
        }
    }