private LevObject(LevObject o) { AnimationNumber = o.AnimationNumber; AppleType = o.AppleType; Position = o.Position.Clone(); Type = o.Type; }
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); }
//====== ctors public AppleEntity(Point position, AppleType appleType, GameTime gameTime) : base(position) { Type = appleType; Verify.NotNull(gameTime, nameof(gameTime)); DelayBeforeDie = gameTime.CreateDelay(TimeSpan.FromSeconds(LifetimeInSeconds)); }
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)); } }
internal int GetGravityAppleCount(AppleType t) { return(Objects.Count(o => o.Type == ObjectType.Apple && o.AppleType == t)); }
public Apple(Coordinat cors, AppleType type) { Type = type; Cors = cors; }