public void Start() { l = new Labirint(); SerDeserTemlate <Labirint> .Serialize(@"C:\Users\Маргарита\Desktop\Курсовой\Resources\Serialize.txt", l); SerDeserTemlate <Labirint> .Deserialize(@"C:\Users\Маргарита\Desktop\Курсовой\Resources\Serialize.txt"); gamer1 = new Pacman(l, new Vector2D(1, 1)); ghosts = new Dictionary <string, Unit> { { "blinky", new Blinky(l, gamer1, l.startPoint["blinky"]) }, { "pinky", new Pinky(l, gamer1, l.startPoint["pinky"]) }, { "inky", new Inky(l, gamer1, l.startPoint["inky"]) }, { "clyde", new Clyde(l, gamer1, l.startPoint["clyde"]) } }; int count = 0; l.Show(); while (!IsLose()) { if (count > 10) { l.OpenGate(); } DoStep(); Show(); count++; if (IsWin()) { Console.WriteLine("You win!!!"); break; } } }
public Clyde(Labirint l, Pacman p, Vector2D position) : base(l, position) { this.p = p; }
public Clyde(Labirint l, Pacman p) : this(l, p, new Vector2D()) { }
public Unit(Labirint l, Vector2D position, Direction direction) { this.l = l; this.previousPosition = this.position = position; this.previousDirection = this.direction = direction; }
public Unit(Labirint l, Vector2D position) : this(l, position, Direction.NULL) { }
public Pinky(Labirint l, Pacman p) : this(l, p, new Vector2D()) { }
public Blinky(Labirint l, Pacman p, Vector2D position) : base(l, position) { this.p = p; }
public Pacman(Labirint l, Vector2D position, Direction direction) : base(l, position, direction) { }
public Pacman(Labirint l, Vector2D position) : this(l, position, Direction.NULL) { }