public ConstructionResult(long completedCount, double investedPoints, double fromStockpile, IConstructionProject project, double leftoverPoints) { this.CompletedCount = completedCount; this.InvestedPoints = investedPoints; this.FromStockpile = fromStockpile; this.Project = project; this.LeftoverPoints = leftoverPoints; }
public bool Compare(IConstructionProject project, ConstructableType targetType) { this.found = false; this.targetType = targetType; project.Accept(this); return(this.found); }
public bool Equals(IConstructionProject project) { var other = project as ShipProject; if (other == null) { return(false); } return(this.Type.Equals(other.Type)); }
public bool Equals(IConstructionProject project) { var other = project as StaticProject; if (other == null) { return(false); } return(this.Type.IdCode == other.Type.IdCode); }
internal ConstructableInfo(IConstructionProject project, IDictionary <string, double> siteVars, ConstructionResult progress, double stockpile) { this.Project = project; this.Stockpile = stockpile; this.infoExtractor = new ConstructionInfoExtractor(project); this.vars = new Var().UnionWith(siteVars).Get; if (progress != null) { this.Investment = progress.InvestedPoints; this.CompletedCount = progress.CompletedCount; this.FromStockpile = progress.FromStockpile; this.Overflow = progress.LeftoverPoints; } }
public IEnumerable <IConstructionProject> Run() { foreach (var item in this.oldQueue) { this.changeItem = false; this.deleteItem = false; this.newProject = null; item.Accept(this); if (!this.changeItem) { this.newQueue.Add(item); } else if (!this.deleteItem) { this.newQueue.Add(newProject); } } return(this.newQueue); }
public ConstructionInfoExtractor(IConstructionProject project) { project.Accept(this); }
public bool Equals(IConstructionProject project) { return(!(project is ShipProject other) ? false : this.Type.Equals(other.Type)); }
public void Visit(ShipProject project) { newProject = new ShipProject(checkDesign(project.Type), false); }
public void Count(IConstructionProject project, long completedCount) { this.completedCount = completedCount; project.Accept(this); }
public void Visit(ShipProject project) { var design = checkDesign(project.Type); newProject = new ShipProject(design, this.designStats[design].Cost, false); }