public SandboxScreen(ScreenNavigation screenNavigation) { this.screenNavigation = screenNavigation; this.player = new Vector(25, 25); this.range = 0.25f; }
public static void Main() { // Resolved deps. var output = new ConsoleOutput(); var characterService = new CharacterService(); var textGenerator = new TextGenerator(); var dialogModalScreenHandler = new DialogModalScreenHandler(textGenerator, output); var screenNavigation = new ScreenNavigation(dialogModalScreenHandler); var connectionManager = new ConnectionManager(); var mainMenuHandler = new MainMenuHandler(screenNavigation, connectionManager); var mainMenuPrinter = new MainMenuPrinter(output, characterService); var mainMenuScreenHandler = new MainMenuScreenHandler(textGenerator, mainMenuHandler, mainMenuPrinter); var characterCreationHandler = new CharacterCreationHandler(screenNavigation); var characterCreationPrinter = new CharacterCreationPrinter(output, characterService); var characterCreationScreenHandler = new CharacterCreationScreenHandler(textGenerator, characterCreationHandler, characterCreationPrinter); var screenProvider = new ScreenHandlerProvider(screenNavigation, mainMenuScreenHandler, characterCreationScreenHandler, dialogModalScreenHandler); // Authenticated and got list of characters from API. var characters = new[] { "1", "2", "ivan-id" }; mainMenuScreenHandler.UpdateState(new MainMenuState(characters)); while (true) { Console.Clear(); var screen = screenProvider.GetCurrentScreenHandler(); screen.PrintState(); var key = Console.ReadKey(); switch (key.Key) { case ConsoleKey.Escape: screen.Escape(); break; case ConsoleKey.Backspace: screen.Backspace(); break; case ConsoleKey.Tab: screen.Tab(); break; default: screen.Type(key.KeyChar); break; } } }
// Use this for initialization public void OnClick() { // authenticate user: Social.localUser.Authenticate((bool success) => { // handle success or failure if (success) { Social.ReportProgress(Play.achievement_election_season, 100.0f, (bool successful) => { }); ScreenNavigation.LoadGameModeScreen(); } }); }
public ScreenFactory( ITextGenerator textGenerator, IConnectionManager connectionManager, ICharactersClient charactersClient, ILocationsClient locationsClient, IOutput output, IPrinter <MainMenuState> mainMenuPrinter, IPrinter <CharacterCreationState> characterCreationPrinter, IPrinter <WorldScreenState> worldPrinter) { _textGenerator = textGenerator; _connectionManager = connectionManager; _charactersClient = charactersClient; _locationsClient = locationsClient; _output = output; _mainMenuPrinter = mainMenuPrinter; _characterCreationPrinter = characterCreationPrinter; _worldPrinter = worldPrinter; // Create this only after initializing everything inside ScreenFactory. ScreenNavigation = new ScreenNavigation(this); Task.Run(() => ScreenNavigation.Screen = GameScreen.MainMenu); }
public ShootEmUpScreen(ScreenNavigation screenNavigation) { this.screenNavigation = screenNavigation; }
void OnClick() { ScreenNavigation.LoadStartMenu(); }
public HubScreen(ScreenNavigation screenNavigation) { this.screenNavigation = screenNavigation; }
public TouchScreen(ScreenNavigation screenNavigation) { this.screenNavigation = screenNavigation; }
// Use this for initialization public void OnClick() { ScreenNavigation.LoadCharacterSelection(); }
public void loadVenue() { ScreenNavigation.LoadGameModeScreen(); }
public TiledScreen(ScreenNavigation screenNavigation) { this.screenNavigation = screenNavigation; this.position = Vector.Zero; }