Esempio n. 1
0
 public SpriteEnergyRelay(EnergyRelay entity, Texture2D texture)
     : base(entity, texture)
 {
     this.relayTexture = TextureManager.Singletone.Get("Beam");
     this.connections = new Dictionary<Entity, Relay>();
 }
Esempio n. 2
0
 private void AddEntityFromFormat(int typeId, string entityData)
 {
     if (typeId == (int)EntityType.Player)
     {
         Character character = new Character(entityData);
         zoneManager.AddEntity(character);
         Logger.Output(this, "AddEntity() added new character ID {0}.", character.Id);
     }
     else if (typeId == (int)EntityType.Unit)
     {
         Unit entity = new Unit(entityData);
         SpriteUnit sprite = new SpriteUnit(entity, TextureManager.Singletone.Get("Windmill"));
         entity.Tag = sprite;
         zoneManager.AddEntity(entity);
         Logger.Output(this, "AddEntity() added new unit ID {0}.", entity.Id);
     }
     else if (typeId == (int)EntityType.EnergyStation)
     {
         EnergyStation station = new EnergyStation(entityData);
         SpriteEnergyStation sprite = new SpriteEnergyStation(station, TextureManager.Singletone.Get("EnergyStation"));
         station.Tag = sprite;
         zoneManager.AddEntity(station);
         Logger.Output(this, "AddEntity() added new energy station ID {0}.", station.Id);
     }
     else if (typeId == (int)EntityType.EnergyRelay)
     {
         EnergyRelay relay = new EnergyRelay(entityData);
         SpriteEnergyRelay sprite = new SpriteEnergyRelay(relay, TextureManager.Singletone.Get("EnergyRelay"));
         relay.Tag = sprite;
         zoneManager.AddEntity(relay);
         Logger.Output(this, "AddEntity() added new energy relay ID {0}.", relay.Id);
     }
     else if (typeId == (int)EntityType.MineralMiner)
     {
         MineralMiner miner = new MineralMiner(entityData);
         SpriteMineralMiner sprite = new SpriteMineralMiner(miner, TextureManager.Singletone.Get("MineralMiner"));
         miner.Tag = sprite;
         zoneManager.AddEntity(miner);
         Logger.Output(this, "AddEntity() added new mineral miner ID {0}.", miner.Id);
     }
     else if (typeId == (int)EntityType.BasicLaser)
     {
         BasicLaser laser = new BasicLaser(entityData);
         zoneManager.AddEntity(laser);
         Logger.Output(this, "AddEntity() added new basic laser ID {0}.", laser.Id);
     }
     else if (typeId == (int)EntityType.PulseLaser)
     {
         PulseLaser laser = new PulseLaser(entityData);
         zoneManager.AddEntity(laser);
         Logger.Output(this, "AddEntity() added new pulse laser ID {0}.", laser.Id);
     }
     else if (typeId == (int)EntityType.TacticalLaser)
     {
         TacticalLaser laser = new TacticalLaser(entityData);
         zoneManager.AddEntity(laser);
         Logger.Output(this, "AddEntity() added new tactical laser ID {0}.", laser.Id);
     }
     else if (typeId == (int)EntityType.Asteroid)
     {
         Asteroid asteroid = new Asteroid(entityData);
         SpriteAsteroid sprite = new SpriteAsteroid(asteroid, TextureManager.Singletone.Get("Asteroid1"));
         asteroid.Tag = sprite;
         zoneManager.AddEntity(asteroid);
         Logger.Output(this, "AddEntity() added new asteroid ID {0}.", asteroid.Id);
     }
     else
     {
         Entity entity = new Entity(entityData);
         zoneManager.AddEntity(entity);
         Logger.Output(this, "AddEntity() added unknown entity type ID {0}.", entity.Id);
     }
 }