// Computer Science 367, Section 3, Fall 1997
// Instructor: Michael Siff (siff@cs.wisc.edu)
//
// Programming Assignment Two
//
//
// FILE: player.h
//
//
// CLASS PROVIDED: Player - class representing the player in the aMAZEd game.
//
// 
// CONSTANT MEMBER for the Player class:
//   char PLAYER 
//     The symbol to appear on the screen representing the player.
//
// CONSTRUCTOR for the Player class:
//   Player(int yy, int xx)
//     Precondition: (yy,xx) are valid coordinates in the current screen
//     window.
//     Postcondition: a player object has been created with (yy,xx) as its
//     coordinates, and the symbol PLAYER drawn at the appropriate location
//     in the screen window.
//
// CONSTANT MEMBER FUNCTIONS for the Player class:
//   int getY() const 
//     Postcondition: returns the y coordinate of the player.
//   int getX() const 
//     Postcondition: returns the x coordinate of the player.
//   void draw() const 
//     Precondition: (yy,xx) are valid coordinates in the current screen
//     window.
//     Postcondition: the symbol PLAYER has been drawn in the screen window
//     at the appropriate location.
//
// MODIFICATION MEMBER FUNCTIONS for the Player class:
//   void go(direction d) 
//     Precondition: the player's coordinates are valid in the current
//     screen window and they are such that after modification according to
//     the direction they will still be valid.
//     Postcondition: the coordinates are updated according to the
//     direction. The symbol PLAYER is removed from the old location. The
//     symbol PLAYER has been drawn in the screen window at the new location.
//   void setYX(int &yy, int &xx)
//     Precondition: (yy,xx) are valid coordinates in the current
//     screen window.
//     Postcondition: the players'coordinates are now (yy,xx). The symbol
//     PLAYER is removed from the old location. The symbol PLAYER has been
//     drawn in the screen window at the new location. 


#ifndef PLAYER_H
#define PLAYER_H

#include "direction.h"

class Player {
public:
  static const char PLAYER = 'p';
  Player(int yy, int xx) : y(yy), x(xx) { draw();}
  int getY() const {return y;}
  int getX() const {return x;}
  void draw() const;
  void go(direction d);
  void setYX(int& yy, int& xx) { y = yy; x = xx; draw(); }
private:
  int y, x;
};



#endif
