Moderator: xxSlayeRxx
class ConsoleApplication
{
//silnik gry
Game game;
public ConsoleApplication()
{
}
public void Run()
{
int choice;
String choiceString;
try
{
do
{
//tutaj tekst
choiceString = Console.ReadLine();
choice = int.Parse(choiceString);
switch (choice)
{
case 1:
{
game = new Game(new Player());
game.Play();
break;
}
case 2:
{
game = new Game(new Computer());
game.Play();
break;
}
case 0:
break;
}
} while(choice != 0 || choice < 1 && choice > 2);
}
catch (Exception E)
{
Console.WriteLine(String.Format("Wystąpił błąd w programie: {0}", E.Message));
}
}
}
class Program
{
static void Main(string[] args)
{
ConsoleApplication application = ConsoleApplication();
application.Run();
}
}
class MyClass
{
private string name;
public MyClass(string name)
{
this.name = name;
}
//właściwość RW
public string Name
{
get {return this.name;}
set {this.name = value;}
}
}
class MyClass
{
private string name;
public MyClass(string name)
{
this.name = name;
}
public string GetName()
{
return this.name;
}
public void SetName(string value)
{
this.name = value;
}
}
public override string getName
{
get
{
return this.name;
}
}
public override string Name
{
get
{
return this.name;
}
}
Powrót do Projekty i kody źródłowe
Użytkownicy przeglądający ten dział: Brak zidentyfikowanych użytkowników i 2 gości