Esempio n. 1
0
 private LevObject(LevObject o)
 {
     AnimationNumber = o.AnimationNumber;
     AppleType       = o.AppleType;
     Position        = o.Position.Clone();
     Type            = o.Type;
 }
Esempio n. 2
0
 internal LevObject(Vector position, ObjectType type, AppleType appleType, int animNum = 1)
 {
     Position        = position;
     Type            = type;
     AppleType       = appleType;
     AnimationNumber = Math.Min(Math.Max(animNum, 1), 9);
 }
Esempio n. 3
0
        //====== ctors

        public AppleEntity(Point position, AppleType appleType, GameTime gameTime) : base(position)
        {
            Type = appleType;

            Verify.NotNull(gameTime, nameof(gameTime));

            DelayBeforeDie = gameTime.CreateDelay(TimeSpan.FromSeconds(LifetimeInSeconds));
        }
Esempio n. 4
0
        private void AddApple(int quantity, AppleType type = AppleType.GrowSize)
        {
            var rand = new Random();

            for (int i = 0; i < quantity; i++)
            {
                var cors = new Coordinat(_field);

                while (_snake.OnSelf(cors))
                {
                    cors = new Coordinat(_field);
                }

                _apples.Add(new Apple(cors, type));
            }
        }
Esempio n. 5
0
 internal int GetGravityAppleCount(AppleType t)
 {
     return(Objects.Count(o => o.Type == ObjectType.Apple && o.AppleType == t));
 }
Esempio n. 6
0
 public Apple(Coordinat cors, AppleType type)
 {
     Type = type;
     Cors = cors;
 }