Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- Renderer renderer = new Renderer();
- Player player = new Player(1,1,'@');
- renderer.DrawPlayer(player);
- Console.WriteLine();
- }
- }
- class Player
- {
- public Player (int x, int y, char ch)
- {
- PositionX = x;
- PositionY = y;
- Symbol = ch;
- }
- public int PositionX { get; private set; }
- public int PositionY { get; private set; }
- public char Symbol { get; private set; }
- }
- class Renderer
- {
- public void DrawPlayer (Player player)
- {
- Console.SetCursorPosition(player.PositionX, player.PositionY);
- Console.WriteLine(player.Symbol);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment