Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Lesson_1
- {
- class Class1
- {
- static void Main(string[] args)
- {
- Player player = new Player(5, 5, '$');
- Render render = new Render();
- render.DrawPlayer(player);
- Console.ReadLine();
- }
- public class Render
- {
- public void DrawPlayer(Player player)
- {
- Console.SetCursorPosition(player.PositionX, player.PositionY);
- Console.Write(player.Sign);
- }
- }
- public class Player
- {
- public Player(int positionX, int positionY, char playerSymbol = '@')
- {
- PositionX = positionX;
- PositionY = positionY;
- Sign = playerSymbol;
- }
- public int PositionX { get; private set; }
- public int PositionY { get; private set; }
- public char Sign { get; private set; }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement