Example #1
0
        public void CreateSpell(Func <int, int, ISpell> spell)
        {
            var newX = 0;
            var newY = 0;

            Useful.XyPlusKeys(X, Y, this.GazeDirection, ref newX, ref newY);
            Model.Spells.AddLast(spell(newX, newY));
        }
Example #2
0
        public bool IsInsideMap(int x, int y, Keys key)
        {
            var newX = 0;
            var newY = 0;

            Useful.XyPlusKeys(x, y, key, ref newX, ref newY);

            return
                (IsInsideMap(newX, newY));
        }
Example #3
0
 private bool checkThree(int x, int y, Keys direction)
 {
     Useful.XyPlusKeys(x, y, direction, ref x, ref y);
     if (!Model.IsInsideMap(x, y))
     {
         return(false);
     }
     return
         (Model.ItemsMap[x, y].Count > 0 &&
          Model.ItemsMap[x, y].Peek() is ThreeItem);
 }
Example #4
0
        public override void ForMoveStart()
        {
            var newX = X;
            var newY = Y;

            Useful.XyPlusKeys(newX, newY, GazeDirection, ref newX, ref newY);
            var willDie = Model.MobMap[newX, newY].Where(mob => mob != this && !(mob is SporeMob)).ToArray();

            for (var i = 0; i < willDie.Length; i++)
            {
                willDie[i].Destroy();
            }
        }
Example #5
0
        private bool checkDirection(Keys key)
        {
            var x = X;
            var y = Y;

            for (int i = 0; i < 2; i++)
            {
                Useful.XyPlusKeys(x, y, key, ref x, ref y);
                if (!Model.IsInsideMap(x, y))
                {
                    return(false);
                }
                if (Model.MobMap[x, y].Count > 0)
                {
                    return(true);
                }
            }
            return(false);
        }