Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal class Program
- {
- static void Main(string[] args)
- {
- Player player1 = new Player(10, 15);
- Draw drawe = new Draw();
- drawe.PutPlayerOnMap(player1.PositionX, player1.PositionY);
- }
- }
- class Player
- {
- private int _positionX;
- private int _positionY;
- public Player (int x, int y)
- {
- PositionX = x;
- PositionY = y;
- }
- public int PositionX
- {
- get
- {
- return _positionX;
- }
- private set
- {
- _positionX = value;
- }
- }
- public int PositionY
- {
- get
- {
- return _positionY;
- }
- private set
- {
- _positionY = value;
- }
- }
- }
- class Draw
- {
- public void PutPlayerOnMap(int x, int y, char playerSymbol = '@')
- {
- Console.SetCursorPosition(x, y);
- Console.Write(playerSymbol);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment