Beispiel #1
0
        public BuildStep(Point onlyPoint, Building toBuild, FullTask parentList)
            : base(null, parentList, TaskType.BUILD)
        {
            this.ToBuild = toBuild;

            this.startPoint = onlyPoint;
            this.endPoint = onlyPoint;

            checkIfBuildActionMakesSense();
        }
Beispiel #2
0
        public BuildStep(Path path, Building toBuild, FullTask parentList)
            : base(path, parentList, TaskType.BUILD)
        {
            this.ToBuild = toBuild;

            this.startPoint = path.Start;
            this.endPoint = path.End;

            checkIfBuildActionMakesSense();
        }
Beispiel #3
0
        public StockpileStep(Path path, Carryable toDropOff, Building stockpile, FullTask parentList)
            : base(path, parentList, TaskType.PUT_DOWN)
        {
            this.ToDropOff = toDropOff;
            this.WhereToPlace = stockpile;

            this.endPoint = path.End;

            if (Path.Start != StartPoint)
                throw new ArgumentException("Path doesn't start where we picked up the item!");
        }
Beispiel #4
0
 /// <summary>
 /// Determines whether or not this Building overlaps a specific other Building
 /// </summary>
 /// <param name="b"></param>
 /// <returns></returns>
 public bool Overlaps(Building b)
 {
     if (this.XMax < b.XMin || b.XMax < this.XMin ||
         this.YMax < b.YMin || b.YMax < this.YMin)
     {
         return false;
     }
     else
     {
         return true;
     }
 }
Beispiel #5
0
        public override void GetPutInStockpile(Building stockpile)
        {
            if (!IsBeingCarried)
                throw new InvalidOperationException("Isn't being carried right now.");

            carryingPerson = null;
            intendedCollector = null;
            currentStockpile = stockpile;

            this.currentState = CarryableState.IN_STOCKPILE;
        }
Beispiel #6
0
        public override void GetPickedUp(InWorldObject picker)
        {
            if (!CanBePickedUp)
                throw new InvalidOperationException("Can't be picked up right now.");

            this.currentState = CarryableState.CARRIED;
            carryingPerson = picker;

            if (IsInStockpile)
            {
                Point coord = SquareCoordinate;
                int x = coord.X;
                int y = coord.Y;

                currentStockpile.RemoveObject(x, y, this);

                currentStockpile = null;
            }
        }
Beispiel #7
0
 /// <summary>
 /// Get put down in a stockpile.  Assumes the current
 /// state is Carried, and should end (barring weirdness)
 /// in current state being InStockpile.
 /// </summary>
 public abstract void GetPutInStockpile(Building stockpile);