VIzlo

Task ООП 2

Jun 9th, 2023 (edited)
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | Gaming | 0 0
  1. namespace ConsoleApp2
  2. {
  3.        internal class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             Player player = new Player();
  8.             Render render = new Render();
  9.  
  10.             render.DrawPlayer(player.PositionX, player.PositionY, player.simsymbol);
  11.             Console.ReadKey();
  12.         }
  13.     }
  14.  
  15.     class Player
  16.     {
  17.         public Player()
  18.         {
  19.             PositionX = 5;
  20.             PositionY = 4;
  21.             simsymbol = "@";
  22.         }
  23.  
  24.         public int PositionX { get; private set; }
  25.         public int PositionY { get; private set; }
  26.         public string simsymbol { get; private set; }
  27.     }
  28.  
  29.     class Render
  30.     {
  31.         public void DrawPlayer(int PositionX, int PositionY, string Simsymbol)
  32.         {
  33.             Console.SetCursorPosition(PositionX, PositionY);
  34.             Console.WriteLine(Simsymbol);
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment