public ProductionComponent(GameEntity entity, ItemInfo input, ItemInfo output, float productionTime) : base(entity, 2) { input_ = input; output_ = output; productionTime_ = productionTime; }
public ItemInfo(GameEntity e, ItemInfo parent, int number = 1) : base(e) { ID_ = parent.ID_; tex_ = parent.tex_; structureID_ = parent.structureID_; number_ = number; state_ = parent.state_; }
public override Component deepCopy(GameEntity entity) { ItemInfo c = new ItemInfo(entity); c.ID_ = ID_; c.tex_ = tex_; c.number_ = number_; c.structureID_ = structureID_; c.state_ = state_; return c; }
public int getNumItem(ItemInfo item) { int response = 0; for (int i = 0; i < capacity_; i++) { if (items_[i] != null && items_[i].item.ID_ == item.ID_) response += items_[i].item.number_; } return response; }
private void initObjects() { int typeId = 0; gunInfo = new InfoComponent(typeId++); gunInfo.name = "Cannon"; gunInfo.flavorText = "Dual purpose weaponry can defend or mine.\nRequires blue orb to function."; gunItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("gun64")); gunItemInfo.structureID_ = gunInfo.typeID_; entities.Add(createGun()); debrisInfo = new InfoComponent(typeId++); debrisInfo.name = "Scrap"; debrisInfo.type = ObjectType.LOOTABLE; entities.Add(createDebris()); wreckInfo = new InfoComponent(typeId++); wreckInfo.name = "Wreck"; wreckInfo.type = ObjectType.SHOOTABLE; entities.Add(createWreck()); tractorInfo = new InfoComponent(typeId++); tractorInfo.name = "Tractor Beam"; tractorInfo.flavorText = "Pulls objects into the ship.\nRequires blue orb to function."; tractorItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("mag128")); tractorItemInfo.structureID_ = tractorInfo.typeID_; entities.Add(createTractor()); furnaceInfo = new InfoComponent(typeId++); furnaceInfo.name = "Furnace"; furnaceInfo.flavorText = "Reforms scrap into usable steel."; furnaceItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("furnace")); furnaceItemInfo.structureID_ = furnaceInfo.typeID_; entities.Add(createFurnace()); tankInfo = new InfoComponent(typeId++); tankInfo.name = "Storage Tank"; tankInfo.flavorText = "Stores liquid or gaseous substances."; tankItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("tank")); tankItemInfo.structureID_ = tankInfo.typeID_; entities.Add(createTank()); compressorInfo = new InfoComponent(typeId++); compressorInfo.name = "Compressor"; compressorInfo.flavorText = "Pressurizes gas, moving it from one entity to another."; compressorItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("compressor")); compressorItemInfo.structureID_ = compressorInfo.typeID_; entities.Add(createCompressor()); pumpInfo = new InfoComponent(typeId++); pumpInfo.name = "Pump"; pumpInfo.flavorText = "Pumps liquids from one entity to another.\nRequires a motor and pinion to function."; pumpItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("pump")); pumpItemInfo.structureID_ = pumpInfo.typeID_; entities.Add(createPump()); combustInfo = new InfoComponent(typeId++); combustInfo.name = "Combustion Chamber"; combustInfo.flavorText = "Burns oxygen and hydrogen."; combustItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("cchamber")); combustItemInfo.structureID_ = combustInfo.typeID_; entities.Add(createCombChamb()); thrustInfo = new InfoComponent(typeId++); thrustInfo.name = "Thruster"; thrustInfo.flavorText = "Directs exploding materials to provide thrust."; thrustItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("thrust")); thrustItemInfo.structureID_ = thrustInfo.typeID_; entities.Add(createThruster()); reactorInfo = new InfoComponent(typeId++); reactorInfo.name = "Reactor"; reactorInfo.flavorText = "Provides power."; reactorItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("reactor")); reactorItemInfo.structureID_ = reactorInfo.typeID_; entities.Add(createReactor()); machineshopInfo = new InfoComponent(typeId++); machineshopInfo.name = "Machine Shop"; machineshopInfo.flavorText = "Creates various components from steel."; machineshopItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("machineshop")); machineshopItemInfo.structureID_ = machineshopInfo.typeID_; entities.Add(createMachineShop()); grinderInfo = new InfoComponent(typeId++); grinderInfo.name = "Grinder"; grinderInfo.flavorText = "Turns things into scrap."; grinderItemInfo = new ItemInfo(Locator.getTextureManager().loadTexture("grinder")); grinderItemInfo.structureID_ = grinderInfo.typeID_; entities.Add(createGrinder()); }
private void initItems() { orbItem = new ItemInfo(Locator.getTextureManager().loadTexture("orb")); scrapItem = new ItemInfo(Locator.getTextureManager().loadTexture("debris1")); steelItem = new ItemInfo(Locator.getTextureManager().loadTexture("steel")); pinionItem = new ItemInfo(Locator.getTextureManager().loadTexture("pinion")); motorItem = new ItemInfo(Locator.getTextureManager().loadTexture("motor")); oxygenItem = new ItemInfo(Locator.getTextureManager().loadTexture("o2")); hydrogenItem = new ItemInfo(Locator.getTextureManager().loadTexture("h2")); }
public GameEntity createItem(ItemInfo item, int count = 1) { GameEntity e = new GameEntity(); e.item = new ItemInfo(e, item, count); return e; }