Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp11
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player = new Player(3, 0);
- player.Show();
- }
- }
- class Player
- {
- private string player = "(*-*)";
- private int _x;
- private int _y;
- public Player(int x, int y)
- {
- _x = x;
- _y = y;
- }
- public int X
- {
- get
- {
- if (_x >= 3)
- {
- return _x;
- }
- else
- {
- Console.WriteLine("Вы ввели не правильно значение"); return 0;
- }
- }
- set
- {
- _x = value;
- }
- }
- public int Y
- {
- get
- {
- return _y;
- }
- set
- {
- _y = value;
- }
- }
- public void Show()
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.SetCursorPosition(X-3,Y);
- Console.Write(player);
- Console.ForegroundColor = ConsoleColor.Gray;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement