Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player = new Player(10, 10, '@');
- Renderer renderer = new();
- renderer.DrawPlayer(player);
- }
- }
- class Player
- {
- public Player(int positionX, int positionY, char symbol)
- {
- PositionX = positionX;
- PositionY = positionY;
- Symbol = symbol;
- }
- public int PositionX { get; private set; }
- public int PositionY { get; private set; }
- public char Symbol { get; private set; }
- }
- class Renderer
- {
- public void DrawPlayer(Player player)
- {
- Console.SetCursorPosition(player.PositionX, player.PositionY);
- Console.WriteLine(player.Symbol);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement