ReadyCreateServerGame

This commit is contained in:
rawer470 2024-08-16 12:35:02 +03:00
parent b2041c07f5
commit 9d9709441c
2 changed files with 9 additions and 3 deletions

View file

@ -39,8 +39,8 @@ public class MainMenuGUI : AbstractGUI
fontName = "Fonts\\Font"
};
playButton.LeftButtonPressed += () =>
{
AppManager.Instance.SetGUI(new SelectModeMenu());
{
AppManager.Instance.SetGUI(new SelectModeMenu());
};
Elements.Add(playButton);
Button optionButton = new Button(Manager)

View file

@ -39,7 +39,13 @@ public class SelectModeMenu : AbstractGUI
playButton.LeftButtonPressed += () =>
{
// single
Server server = new Server(); //Server Logic SinglePlayer
Client client = new Client();
server.CreateRoom(1);
client.JoinYourself();
AppManager.Instance.SetServer(server);
AppManager.Instance.SetClient(client);
AppManager.Instance.ChangeState(GameState.HostPlaying);
// ваш код здесь
};
Elements.Add(playButton);