Exemplo n.º 1
0
 public override void AffectObject(IPositionalObject obj)
 {
     if (obj is IDweller dweller)
     {
         dweller.EnterBuilding(BuildingToEnter);
     }
 }
Exemplo n.º 2
0
 // give health to a sleepy dweller
 public override void AffectObject(IPositionalObject obj)
 {
     if (obj is IDweller d)
     {
         d.Health.Value += RewardPerIteration;
     }
 }
Exemplo n.º 3
0
        private void Tile_ActualPositionChanged(object sender, IPositionalObject e)
        {
            if (sender is IAnimationHostTile tile)
            {
                var newX = tile.CurrentX;
                var newY = tile.CurrentY;

                var oldX = e.Position.PreviousValue.X;
                var oldY = e.Position.PreviousValue.Y;

                if (e is IDweller d)
                {
                    // how much food do we take?
                    double foodNeeded = Math.Sqrt(Math.Pow(oldX - newX, 2) + Math.Pow(oldY - newY, 2)) / FoodScale;
                    d.UseFood(foodNeeded);


                    // update the coords that the object displays
                }
                //else
                //{

                //}
            }
        }
Exemplo n.º 4
0
 // Feed a hungry dweller
 public override void AffectObject(IPositionalObject obj)
 {
     if (obj is IDweller d)
     {
         d.Food.Value  += RewardPerIteration;
         d.Money.Value -= ResourceCostPerIteration;
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Easy version: Just zap there...
        /// </summary>
        /// <param name="obj"></param>
        public override void AffectObject(IPositionalObject obj)
        {
            if (obj is IRoamingDweller dweller)
            {
                dweller.ActuallyMoveTo(Destination);
            }


            // setting the Position.Values will fire the Changed events on those objects
            //obj.Position.Value = Destination.Value;
        }
Exemplo n.º 6
0
 public void AffectObject(IPositionalObject obj) => Building.AffectObject(obj);
Exemplo n.º 7
0
 public virtual void AffectObject(IPositionalObject obj)
 {
 }
Exemplo n.º 8
0
 public abstract void AffectObject(IPositionalObject obj);