IGRODELOFF

Task39

Jun 21st, 2022 (edited)
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Task39
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Renderer render = new Renderer();
  14.             Player player = new Player(5, 5);
  15.  
  16.             render.Draw(player.PositionX, player.PositionY);
  17.         }
  18.     }
  19.     class Renderer
  20.     {
  21.         public void Draw(int positionX, int positionY, char ch = '@')
  22.         {
  23.             Console.SetCursorPosition(positionX, positionY);
  24.             Console.Write(ch);
  25.         }
  26.     }
  27.  
  28.     class Player
  29.     {
  30.         public int PositionX { get; private set; }
  31.         public int PositionY { get; private set; }
  32.  
  33.         public Player(int positionX, int positionY)
  34.         {
  35.             PositionX = positionX;
  36.             PositionY = positionY;
  37.         }
  38.     }
  39. }
  40.  
Add Comment
Please, Sign In to add comment