Skip to content

Instantly share code, notes, and snippets.

@VladimirYus
Created January 26, 2026 01:03
Show Gist options
  • Select an option

  • Save VladimirYus/8dd98ce6ae326946a4988073fd1373f0 to your computer and use it in GitHub Desktop.

Select an option

Save VladimirYus/8dd98ce6ae326946a4988073fd1373f0 to your computer and use it in GitHub Desktop.
Properties
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