public GameState() { UUIDGenerator.SetUUID(0); EntityHashSet = new Dictionary <int, IEntity>(); teams = new RTSTeam[MAX_PLAYERS]; activeTeams = new IndexedTeam[0]; Regions = new List <ImpactRegion>(); // No Data Yet Available VoxState = new VoxState(); VoxState.World.worldMin = Point.Zero; Scripts = new Dictionary <string, ReflectedScript>(); grid = new LevelGrid(); //grid.L0 = null; grid.L1 = null; grid.L2 = null; curFrame = 0; timePlayed = 0f; tbMemBuildings = new TimeBudget(BUILDING_MEMORIZATION_LATENCY); lckParticles = new object(); particles = new List <Particle>(); tmpParticles = new List <Particle>(); }
public static void Deserialize(BinaryReader s, Dictionary <string, ReflectedScript> res, GameState state) { state.curFrame = s.ReadInt32(); state.timePlayed = s.ReadSingle(); UUIDGenerator.SetUUID(s.ReadInt32()); state.Scripts = new Dictionary <string, ReflectedScript>(res); int c = s.ReadInt32(); for (int i = 0; i < c; i++) { int ti = s.ReadInt32(); state.teams[ti] = RTSTeam.Deserialize(s, ti, state); } state.UpdateActiveTeams(); c = s.ReadInt32(); for (int i = 0; i < c; i++) { var ebu = EnemyBuildingUpdater.Deserialize(s, state); state.tbMemBuildings.AddTask(ebu); } LevelGrid.Deserialize(s, state); }