Beispiel #1
0
 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);
        }
Beispiel #3
0
        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);
        }
Beispiel #5
0
        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;
            }
        }
Beispiel #6
0
        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);
 }
Beispiel #8
0
 public bool Equals(IConstructionProject project)
 {
     return(!(project is ShipProject other) ? false : this.Type.Equals(other.Type));
 }
Beispiel #9
0
 public void Visit(ShipProject project)
 {
     newProject = new ShipProject(checkDesign(project.Type), false);
 }
Beispiel #10
0
 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);
        }