Advertisement
dmitryEfremov

Untitled

Jun 19th, 2020
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. using Microsoft.VisualBasic;
  2. using System;
  3. using System.ComponentModel;
  4. using System.Runtime.CompilerServices;
  5. using System.Runtime.InteropServices.ComTypes;
  6. using System.Security.Cryptography.X509Certificates;
  7.  
  8. namespace ConsoleApp11
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. Player player = new Player(2, 0);
  15. new Shows().Show(player.X, player.Y, "@");
  16.  
  17. }
  18. }
  19. class Player
  20. {
  21.  
  22. private int _x;
  23. private int _y;
  24.  
  25. public int X
  26. {
  27. get
  28. {
  29. return _x;
  30. }
  31. set
  32. {
  33. if (value >= 0 && value <= 90)
  34. {
  35. _x = value;
  36. }
  37. else
  38. {
  39. Console.WriteLine("Неверное значение");
  40. }
  41. }
  42. }
  43.  
  44. public int Y
  45. {
  46. get
  47. {
  48. return _y;
  49. }
  50. set
  51. {
  52. if (value >= 0 && value <= 90)
  53. {
  54. _y = value;
  55. }
  56. else
  57. {
  58. Console.WriteLine("Неверное значение");
  59. }
  60. }
  61. }
  62.  
  63.  
  64. public Player(int x, int y)
  65. {
  66. X = x;
  67. Y = y;
  68. }
  69.  
  70. public void Show()
  71. {
  72.  
  73. }
  74. }
  75.  
  76. class Shows
  77. {
  78. public void Show(int x, int y, string player)
  79. {
  80. Console.ForegroundColor = ConsoleColor.Red;
  81. Console.SetCursorPosition(x, y);
  82. Console.Write(player);
  83. Console.ForegroundColor = ConsoleColor.Gray;
  84. }
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement