public ConsoleGameBuilder(IConsoleUI ui) : base(ui) { ui.DisplayStartScreen(); bool startGame = false; while (startGame == false) { startGame = ui.DisplayReadyScreen(); } List <IGamePlayer> players = ui.DisplayEnterPlayersScreen(); NoughtCrossToken token = ui.DisplayEnterPlayerOneTokenScreen(); IGameSquare[][] squares = new GameSquare[3][]; for (int i = 0; i < 3; i++) { squares[i] = new GameSquare[3]; for (int j = 0; j < 3; j++) { squares[i][j] = new GameSquare(); } } IGameBoard board = new GameBoard(squares); _gameEngine = new GameEngine(players, board, players[0].Id, token, new GameVictoryCalculator(GameWinStates.GetStates())); }
public static void Init(IConsoleUI consoleUi) { _consoleUi = consoleUi; consoleUi.Init(); AddCommand("help", CmdHelp, "Show available commands"); AddCommand("clear", CmdClear, "Clear area text"); AddCommand("commit", CmdCommit, "Commit command test"); OutputString("Console ready"); }
public SinglePlayerMode(IConsoleUI consoleUI, IHumanPlayerFactory humanPlayerFactory, IComputerAdversaryFactory computerAdversaryFactory, ILogger logger) : base(consoleUI, logger) { AddPlayer(PlayerNumber.Player1, humanPlayerFactory.CreateHumanPlayer(_consoleUI)); // Setup computer opponent IComputerAdversary adversary = computerAdversaryFactory.CreateComputerAdversary(); adversary.SetStrategy(GameStrategyType.Believable); AddPlayer(PlayerNumber.Player2, adversary); }
public static void Init(IConsoleUI consoleUI) { GameDebug.Assert(s_ConsoleUI == null); s_ConsoleUI = consoleUI; s_ConsoleUI.Init(); AddCommand("help", CmdHelp, "Show available commands"); AddCommand("vars", CmdVars, "Show available variables"); AddCommand("wait", CmdWait, "Wait for next frame or level"); AddCommand("exec", CmdExec, "Executes commands from file"); Write("Console ready"); }
public static void Init(string buildId, string buildUnityVersion, IConsoleUI consoleUI) { GameDebug.Assert(s_ConsoleUI == null); s_ConsoleUI = consoleUI; s_ConsoleUI.Init(buildId, buildUnityVersion); AddCommand("help", CmdHelp, "Show available commands"); AddCommand("vars", CmdVars, "Show available variables"); AddCommand("wait", CmdWait, "Wait for next frame or level"); // AddCommand("waitload", CmdWaitLoad, "Wait for level load"); AddCommand("exec", CmdExec, "Executes commands from file"); Write("Console ready"); }
public void Emit(LogEvent logEvent) { StringWriter writer = new StringWriter(); formatter.Format(logEvent, writer); string message = writer.ToString(); message = message.Remove(message.Length - 2, 2); IConsoleUI console = ConsoleSetup.ConsoleUI; if (console == null) { return; } switch (logEvent.Level) { case LogEventLevel.Verbose: console.LogMessage(message, LogType.Log); break; case LogEventLevel.Debug: console.LogMessage(message, LogType.Assert); break; case LogEventLevel.Information: console.LogMessage(message, LogType.Log); break; case LogEventLevel.Warning: console.LogMessage(message, LogType.Warning); break; case LogEventLevel.Error: console.LogMessage(message, LogType.Error); break; case LogEventLevel.Fatal: console.LogMessage(message, LogType.Error); break; default: throw new ArgumentOutOfRangeException(); } }
public static void Init(IConsoleUI consoleUI) { if (isInit) { return; } s_ConsoleUI = consoleUI; s_ConsoleUI.Init(); AddCommand("help", CmdHelp, "Show available commands", CmdHelpAutocomplete); AddCommand("vars", CmdVars, "Show available variables"); AddCommand("wait", CmdWait, "Wait for X frames"); AddCommand("exec", CmdExec, "Executes commands from file"); Write("Console ready"); isInit = true; }
private void Start() { if (ConsoleUI != null) { Destroy(gameObject); Logger.Warn("You should only ever load this script on a bootloader scene!"); return; } //If we are headless we need to create a console UI using the OS's terminal //I really which Unity would have this included... if (Game.IsHeadless) { #if UNITY_STANDALONE_WIN ConsoleUI = new ConsoleWindows($"{Application.productName} Server"); #elif UNITY_STANDALONE_LINUX ConsoleUI = new ConsoleLinux($"{Application.productName} Server"); #elif UNITY_STANDALONE_OSX //TODO: Add console for OSX #endif } else { GameObject consoleUiPrefab = Addressables.LoadAssetAsync <GameObject>(ConsoleUiPrefabPath).WaitForCompletion(); //Create in-game console GUI ConsoleUI = Instantiate(consoleUiPrefab, transform).GetComponent <ConsoleGUI>(); } //Init the console ConsoleUI.Init(); //Init the backend of the console ConsoleBackend.InitConsoleBackend(); //Exec autoexec ConsoleBackend.ExecuteFileCommand(new[] { "autoexec" }); }
public IHumanPlayer CreateHumanPlayer(IConsoleUI consoleUI) { return(new HumanPlayer(consoleUI)); }
public HumanPlayer(IConsoleUI consoleUI) { _consoleUI = consoleUI; }
static void addMoarCommands(Console __instance, IConsoleUI consoleUI) { addCommands.Invoke(__instance, new object[] { typeof(CommandsPatcher) }); }
public PackageIndexManager(IConsoleUI consoleUI) { _consoleUI = consoleUI; }
public GarageHandler(IConsoleUI ui) { UI = ui; }
/// <summary> /// Constructor /// </summary> /// <param name="parent">Parent</param> public Panel(IConsoleUI parent) : base(parent) { // ... }
public Canvas(IConsoleUI parent) : base(parent) { // ... }
public BaseConsoleGameBuilder(IConsoleUI ui) { _ui = ui; }
public PlayerVersusPlayerMode(IConsoleUI consoleUI, IHumanPlayerFactory humanPlayerFactory, ILogger logger) : base(consoleUI, logger) { AddPlayer(PlayerNumber.Player1, humanPlayerFactory.CreateHumanPlayer(_consoleUI)); AddPlayer(PlayerNumber.Player2, humanPlayerFactory.CreateHumanPlayer(_consoleUI)); }
public static void Shutdown() { s_ConsoleUI.Shutdown(); s_ConsoleUI = null; }
protected ConsoleGameModeBase(IConsoleUI consoleUI, ILogger logger) { _consoleUI = consoleUI; _logger = logger; }