Ejemplo n.º 1
0
        public override void Unpack(byte[] data)
        {
            Reset(data);

            GameStyle   = (GameTypes)ReadUInt16();
            GameOptions = (GameOptionFlags)ReadUInt16();
            MaxPlayers  = ReadUInt16();
            MaxShots    = ReadUInt16();

            TeamData.Clear();
            for (TeamColors t = TeamColors.RogueTeam; t <= TeamColors.ObserverTeam; t++)
            {
                TeamInfo info = new TeamInfo();
                info.Team = t;
                info.Size = ReadUInt16();
                TeamData.Add(t, info);
            }
            for (TeamColors t = TeamColors.RogueTeam; t <= TeamColors.ObserverTeam; t++)
            {
                TeamInfo info = TeamData[t];
                info.Max = ReadUInt16();
            }

            ShakeWins    = ReadUInt16();;
            ShakeTimeout = ReadUInt16();;

            MaxPlayerScore = ReadUInt16();;
            MaxTeamScore   = ReadUInt16();;
            ElapsedTime    = ReadUInt16();;
        }
Ejemplo n.º 2
0
 public void SetGameOption(GameOptionFlag flag, bool on)
 {
     if (on)
     {
         GameOptionFlags = GameOptionFlags.WithGameOption(flag);
     }
     else
     {
         GameOptionFlags = GameOptionFlags.WithoutGameOption(flag);
     }
 }
Ejemplo n.º 3
0
        public override void Unpack(byte[] data)
        {
            Reset(data);

            WorldSize   = ReadFloat();
            GameType    = (GameTypes)ReadUInt16();
            GameOptions = (GameOptionFlags)ReadUInt16();
            MaxPlayers  = ReadUInt16();
            MaxShots    = ReadUInt16();
            MaxFlags    = ReadUInt16();

            LinearAcceleration  = ReadFloat();
            AngularAcceleration = ReadFloat();

            ShakeTimeout     = 0.1f * ReadUInt16();
            ShakeWins        = ReadUInt16();
            UsedToBeSyncTime = (int)ReadUInt32();
        }
Ejemplo n.º 4
0
 public bool HasGameOption(GameOptionFlag gameOptionFlag)
 {
     return(GameOptionFlags.HasGameOption(gameOptionFlag));
 }