Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace OOP
- {
- class Program
- {
- static void Main(string[] args)
- {
- Render renderer = new Render();
- Player player = new Player(10, 10);
- renderer.DrawPlayer(player.X, player.Y);
- }
- }
- class Player
- {
- public int X { get; private set; }
- public int Y { get; private set; }
- public Player(int x, int y)
- {
- X = x;
- Y = y;
- }
- }
- class Render
- {
- public void DrawPlayer(int x, int y, char ch = '@')
- {
- Console.SetCursorPosition(x, y);
- Console.Write(ch);
- }
- }
- }
Add Comment
Please, Sign In to add comment