Advertisement
Nemo048

Untitled

Aug 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2.  
  3. namespace lesson7_4potok
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Human human = new Human(1, 2, 2, "Семен");
  10.  
  11.             Console.WriteLine("У вашего человека {0} руки", human.GetHands());
  12.             Console.WriteLine("Молодец {0}!", human.GetName());
  13.  
  14.         }
  15.     }
  16.  
  17.     class Human
  18.     {
  19.         private int Head;
  20.         private int Hands;
  21.         private int Legs;
  22.         private string Name;
  23.  
  24.         public Human(int head, int hands, int legs)
  25.         {
  26.             Head = head;
  27.             Hands = hands;
  28.             Legs = legs;
  29.         }
  30.  
  31.         public Human(int head, int hands, int legs, string name)
  32.         {
  33.             Head = head;
  34.             Hands = hands;
  35.             Legs = legs;
  36.             Name = name;
  37.         }
  38.  
  39.         public string GetName()
  40.         {
  41.             return Name;
  42.         }
  43.  
  44.         public int GetHands()
  45.         {
  46.             return Hands;
  47.         }
  48.     }
  49.  
  50.     class Player
  51.     {
  52.         private int X = 10;
  53.         private int Y = 10;
  54.         public ConsoleColor PlayerColor = ConsoleColor.DarkRed;
  55.         public char PlayerSymbol = 'x';
  56.  
  57.         public void SetX(int x)
  58.         {
  59.             X = x;
  60.         }
  61.  
  62.         public void SetY(int y)
  63.         {
  64.             Y = y;
  65.         }
  66.  
  67.         public int GetX()
  68.         {
  69.             return X;
  70.         }
  71.  
  72.         public int GetY()
  73.         {
  74.             return Y;
  75.         }
  76.  
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement