Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.VisualBasic;
- using System;
- using System.ComponentModel;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices.ComTypes;
- using System.Security.Cryptography.X509Certificates;
- namespace ConsoleApp11
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player = new Player(2, 0);
- new Shows().Show(player.X, player.Y, "@");
- }
- }
- class Player
- {
- private int _x;
- private int _y;
- public int X
- {
- get
- {
- return _x;
- }
- set
- {
- if (value >= 0 && value <= 90)
- {
- _x = value;
- }
- else
- {
- Console.WriteLine("Неверное значение");
- }
- }
- }
- public int Y
- {
- get
- {
- return _y;
- }
- set
- {
- if (value >= 0 && value <= 90)
- {
- _y = value;
- }
- else
- {
- Console.WriteLine("Неверное значение");
- }
- }
- }
- public Player(int x, int y)
- {
- X = x;
- Y = y;
- }
- public void Show()
- {
- }
- }
- class Shows
- {
- public void Show(int x, int y, string player)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.SetCursorPosition(x, y);
- Console.Write(player);
- Console.ForegroundColor = ConsoleColor.Gray;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement