private void LookupEnergyTanks( RequestCache requestCache) { int energyTankCount = requestCache.GetEnergyTanks(m_room_key).Count(); int energyTankIndex = 0; m_energyTanks = new EnergyTankState[energyTankCount]; foreach (EnergyTank energyTank in requestCache.GetEnergyTanks(m_room_key)) { m_energyTanks[energyTankIndex] = new EnergyTankState { energy_tank_id = energyTank.ID, energy = energyTank.Energy, ownership = (int)energyTank.Faction, room_x = energyTank.RoomKey.x, room_y = energyTank.RoomKey.y, room_z = energyTank.RoomKey.z, x = energyTank.Position.x, y = energyTank.Position.y }; ++energyTankIndex; } }
private int LookupEntities( RequestCache requestCache) { foreach (Mob mob in requestCache.GetMobs(m_roomKey)) { m_mobContexts.Add(new MobUpdateContext(this, mob)); } // Don't bother looking up anything else if there are no mobs if (m_mobContexts.Count > 0) { m_energyTanks = requestCache.GetEnergyTanks(m_roomKey).ToList(); m_players = requestCache.GetPlayers(m_roomKey).ToList(); } return(m_mobContexts.Count); }
private void LookupEnergyTanks( RequestCache requestCache) { int energyTankCount = requestCache.GetEnergyTanks(m_room_key).Count(); int energyTankIndex = 0; m_energyTanks = new EnergyTankState[energyTankCount]; foreach (EnergyTank energyTank in requestCache.GetEnergyTanks(m_room_key)) { m_energyTanks[energyTankIndex] = new EnergyTankState { energy_tank_id = energyTank.ID, energy = energyTank.Energy, ownership = (int)energyTank.Faction, room_x = energyTank.RoomKey.x, room_y = energyTank.RoomKey.y, room_z = energyTank.RoomKey.z, x = energyTank.Position.x, y = energyTank.Position.y }; ++energyTankIndex; } }
private int LookupEntities( RequestCache requestCache) { foreach (Mob mob in requestCache.GetMobs(m_roomKey)) { m_mobContexts.Add(new MobUpdateContext(this, mob)); } // Don't bother looking up anything else if there are no mobs if (m_mobContexts.Count > 0) { m_energyTanks = requestCache.GetEnergyTanks(m_roomKey).ToList(); m_players = requestCache.GetPlayers(m_roomKey).ToList(); } return m_mobContexts.Count; }