Advertisement
TwinFrame

Clight_39_PropertiesPlayer

Aug 7th, 2023 (edited)
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. class Program
  2. {
  3.     static void Main()
  4.     {
  5.         Renderer renderer = new Renderer();
  6.         Player player = new Player(1, 2, '%');
  7.  
  8.         renderer.Draw(player.PositionX, player.PositionY, player.Symbol);
  9.     }
  10. }
  11.  
  12. class Renderer
  13. {
  14.     public void Draw(int positionX, int positionY, char symbol)
  15.     {
  16.         Console.SetCursorPosition(positionX, positionY);
  17.         Console.Write(symbol);
  18.     }
  19. }
  20.  
  21. class Player
  22. {
  23.     public Player(int positionX, int positionY, char symbol)
  24.     {
  25.         PositionX = positionX;
  26.         PositionY = positionY;
  27.         Symbol = symbol;
  28.     }
  29.  
  30.     public char Symbol { get; private set; }
  31.     public int PositionX { get; private set; }
  32.     public int PositionY { get; private set; }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement