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