Askor

Hw29

Nov 19th, 2020 (edited)
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2.  
  3. namespace OOP
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Render renderer = new Render();
  10.             Player player = new Player(10, 10);
  11.  
  12.             renderer.DrawPlayer(player.X, player.Y);
  13.         }
  14.     }
  15.  
  16.     class Player
  17.     {
  18.         public int X { get; private set; }
  19.         public int Y { get; private set; }
  20.         public Player(int x, int y)
  21.         {
  22.             X = x;
  23.             Y = y;
  24.         }
  25.     }
  26.  
  27.     class Render
  28.     {
  29.         public void DrawPlayer(int x, int y, char ch = '@')
  30.         {
  31.             Console.SetCursorPosition(x, y);
  32.             Console.Write(ch);
  33.         }
  34.     }
  35. }
  36.  
Add Comment
Please, Sign In to add comment