public ShipDesignSlot(TechHullSlot hullSlot, TechHullComponent hullComponent, int quantity) : base() { this.hullSlot = hullSlot; this.hullComponent = hullComponent; if (this.hullComponent != null) { this.hullComponentName = hullComponent.getName(); } this.quantity = quantity; }
public void setHullComponent(TechHullComponent hullComponent) { this.hullComponent = hullComponent; if (this.hullComponent == null) { hullComponentName = null; } else { hullComponentName = this.hullComponent.getName(); } }
/** * Initialize the Player techs with the tech store */ public void init(Player player, TechStore techStore) { engines = new List <TechEngine>(); scanners = new List <TechHullComponent>(); shields = new List <TechHullComponent>(); armor = new List <TechHullComponent>(); torpedos = new List <TechHullComponent>(); beamWeapons = new List <TechHullComponent>(); hulls = new List <TechHull>(); starbases = new List <TechHull>(); planetaryScanners = new List <TechPlanetaryScanner>(); defenses = new List <TechDefence>(); techsForCategory = new Dictionary <TechCategory, List <Tech> >(); hullComponents = new List <TechHullComponent>(); bestEngine = addPlayerTechs(player, techStore.getAllEngines(), engines); bestScanner = addPlayerTechs(player, techStore.getAllScanners(), scanners); bestShield = addPlayerTechs(player, techStore.getAllShields(), shields); bestArmor = addPlayerTechs(player, techStore.getAllArmor(), armor); bestTorpedo = addPlayerTechs(player, techStore.getAllTorpedos(), torpedos); bestBeamWeapon = addPlayerTechs(player, techStore.getAllBeamWeapons(), beamWeapons); bestHull = addPlayerTechs(player, techStore.getAllHulls(), hulls); bestStarbase = addPlayerTechs(player, techStore.getAllStarbases(), starbases); bestPlanetaryScanner = addPlayerTechs(player, techStore.getAllPlanetaryScanners(), planetaryScanners); bestDefense = addPlayerTechs(player, techStore.getAllDefenses(), defenses); foreach (TechCategory category in Enum.GetValues(typeof(TechCategory))) { techsForCategory.Add(category, new List <Tech>()); } foreach (Tech tech in techStore.getAll()) { if (player.hasTech(tech)) { List <Tech> t = techsForCategory[tech.getCategory()]; t.Add(tech); if (tech is TechHullComponent) { hullComponents.Add((TechHullComponent)tech); } } } foreach (TechCategory category in Enum.GetValues(typeof(TechCategory))) { techsForCategory[category] = techsForCategory[category].OrderBy(t => t.getRanking()).ToList <Tech>(); } hullComponents = hullComponents.OrderBy(t => t.getRanking()).ToList <TechHullComponent>(); }
/** * Assign a slot with a hull component and a quantity */ public void assignSlot(ShipDesignSlot slot, TechHullComponent hullComponent, int quantity) { if (slot.getHullComponent() == hullComponent) { slot.setQuantity(slot.getQuantity() + quantity); } else { slot.setHullComponent(hullComponent); slot.setQuantity(quantity); } if (slot.getQuantity() > slot.getHullSlot().getCapacity()) { slot.setQuantity(slot.getHullSlot().getCapacity()); } }
public void setBestBeamWeapon(TechHullComponent bestBeamWeapon) { this.bestBeamWeapon = bestBeamWeapon; }
public void setBestTorpedo(TechHullComponent bestTorpedo) { this.bestTorpedo = bestTorpedo; }
public void setBestShield(TechHullComponent bestShield) { this.bestShield = bestShield; }
public void setBestArmor(TechHullComponent bestArmor) { this.bestArmor = bestArmor; }
public void setBestScanner(TechHullComponent bestScanner) { this.bestScanner = bestScanner; }