Exemplo n.º 1
0
        private void changePlayerSlot(int slotID, PreGameSlotType newType, PlayerInfo newInfo, PreGamePeer newPeer, bool newIsReady)
        {
            removeOldPeerFromSlot(slotID, newPeer);

            playerSlots[slotID].peer = newPeer;
            playerSlots[slotID].info.belongsToPlayer = newPeer == null ? "" : newPeer.info.username;

            playerSlots[slotID].info.slotID     = slotID;
            playerSlots[slotID].info.playerInfo = newInfo;
            playerSlots[slotID].info.type       = newType;
            playerSlots[slotID].info.isReady    = newIsReady;
        }
Exemplo n.º 2
0
 private bool getIsPreReady(PreGameSlotType type, PreGamePeer peer)
 {
     if ((type == PreGameSlotType.TrainingBot || type == PreGameSlotType.Human))
     {
         return(true);
     }
     if (type == PreGameSlotType.SelfClone)
     {
         return(peer.isReady);
     }
     return(false);
 }
Exemplo n.º 3
0
 private static void addLocalPlayer(PreGameSlotType type)
 {
     if (type == PreGameSlotType.Player)
     {
         ClientPlayersHandler.addSelf();
     }
     else if (type == PreGameSlotType.TrainingBot)
     {
         LocalTrainingBots.addBot(gameSpecs.type);
     }
     else if (type == PreGameSlotType.SelfClone)
     {
         ClientPlayersHandler.addClone();
     }
     else if (type == PreGameSlotType.Human)
     {
         ClientPlayersHandler.addHuman();
     }
 }