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();; }
public void SetGameOption(GameOptionFlag flag, bool on) { if (on) { GameOptionFlags = GameOptionFlags.WithGameOption(flag); } else { GameOptionFlags = GameOptionFlags.WithoutGameOption(flag); } }
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(); }
public bool HasGameOption(GameOptionFlag gameOptionFlag) { return(GameOptionFlags.HasGameOption(gameOptionFlag)); }