Created
January 26, 2026 01:03
-
-
Save VladimirYus/8dd98ce6ae326946a4988073fd1373f0 to your computer and use it in GitHub Desktop.
Properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace Properties | |
| { | |
| internal class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Renderer renderer = new Renderer(); | |
| Player player = new Player(40, 20, '@'); | |
| renderer.Draw(player); | |
| } | |
| } | |
| class Renderer | |
| { | |
| public void Draw(Player player) | |
| { | |
| Console.CursorVisible = false; | |
| Console.SetCursorPosition(player.X, player.Y); | |
| Console.Write(player.Character); | |
| } | |
| } | |
| class Player | |
| { | |
| public int X { get; private set; } | |
| public int Y { get; private set; } | |
| public char Character { get; private set; } | |
| public Player(int x, int y, char character) | |
| { | |
| X = x; | |
| Y = y; | |
| Character = character; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment