public void RosterBuilder_Constructor_GivenNoArgs_UsesDefaultConfig()
        {
            var rb = new RosterBuilder();

            Assert.Equal(RosterBuilder.DefaultNursesPerShift, rb.config.NursesPerShift);
            Assert.Equal(RosterBuilder.DefaultShiftNames, rb.config.ShiftNames);
        }
Exemplo n.º 2
0
 private void InitializePanelContent(string panelName)
 {
     switch (panelName)
     {
     case "RosterBuilderPanel": RosterBuilder.Initialize();
         break;
     }
 }
Exemplo n.º 3
0
    private void RpcRosterTest()
    {
        string text = (isServer) ? "Hello from server" : "Hello from client";

        text += "\nMy first ship is " + RosterBuilder.TestGetNameOfFirstShipInRoster();
        Network.UpdateAllShipNames(RosterBuilder.TestGetNameOfFirstShipInRoster() + "\n");
        Network.ShowMessage(text);

        Network.FinishTask();
    }
Exemplo n.º 4
0
 public void StartBattle()
 {
     if (!IsNetworkGame())
     {
         RosterBuilder.StartLocalGame();
     }
     else
     {
         GameObject squadBuilerPanel = GameObject.Find("UI/Panels").transform.Find("MultiplayerDecisionPanel").gameObject;
         ChangePanel(squadBuilerPanel);
     }
 }
        public void RosterBuilder_Constructor_GivenArgs_OverridesDefaultConfig()
        {
            var config = new RosterConfig {
                NursesPerShift = 18,
                ShiftNames     = new string[2] {
                    "day", "night"
                }
            };
            var rb = new RosterBuilder(config);

            Assert.Equal(config, rb.config);
        }
Exemplo n.º 6
0
    private void Start()
    {
        DontDestroyOnLoad(this.gameObject);

        if (isLocalPlayer)
        {
            Network.CurrentPlayer = this;

            if (Network.ReadyToStartMatch)
            {
                Network.ReadyToStartMatch = false;
                RosterBuilder.StartNetworkGame();
            }
        }
    }
Exemplo n.º 7
0
    public void RpcSendSquadToOpponent(string squadsJsonString)
    {
        JSONObject squadsJson = new JSONObject(squadsJsonString);

        if (squadsJson.HasField("Server"))
        {
            JSONObject squadJson = squadsJson["Server"];
            RosterBuilder.SetPlayerSquadFromImportedJson(squadJson, Players.PlayerNo.Player1, delegate { });
        }

        if (squadsJson.HasField("Client"))
        {
            JSONObject squadJson = squadsJson["Client"];
            RosterBuilder.SetPlayerSquadFromImportedJson(squadJson, Players.PlayerNo.Player2, Network.FinishTask);
        }
    }
Exemplo n.º 8
0
        /// <param name="start">The start date of the schedule</param>
        /// <param name="end">The end date of the schedule</param>
        /// <param name="inputFile">The input file to use for schedule generation</param>
        public static int Main(DateTime start, DateTime end, NursesFile inputFile)
        {
            try {
                _validateInputs(start, end);
                var nurses = NursesFileReader.readCSV(inputFile);
                Console.WriteLine($"\nfound data for {nurses.Count} nurses in {inputFile.FullName}");
                Console.WriteLine($"\ncalculating roster for {start.ToString("d")} until {end.ToString("d")}");
                var roster = new RosterBuilder().Build(start, end, nurses);
                roster.Write();
            }
            catch (Exception ex)
            {
                Console.WriteLine("\nError: {0}", ex.Message);
                return((int)ExitCode.Failure);
            }

            return((int)ExitCode.Success);
        }
Exemplo n.º 9
0
    public void RpcGetSquadList()
    {
        GameMode.CurrentGameMode = new NetworkGame();

        RosterBuilder.ShowOpponentSquad();
        RosterBuilder.HideNetworkManagerHUD();

        Global.RemoveAllPlayers();
        if (IsServer)
        {
            Global.AddPlayer(typeof(Players.HumanPlayer));
            Global.AddPlayer(typeof(Players.NetworkOpponentPlayer));
        }
        else
        {
            Global.AddPlayer(typeof(Players.NetworkOpponentPlayer));
            Global.AddPlayer(typeof(Players.HumanPlayer));
        }

        JSONObject localSquadList = RosterBuilder.GetSquadInJson(Players.PlayerNo.Player1);

        Network.StoreSquadList(localSquadList.ToString(), isServer);
        Network.FinishTask();
    }
Exemplo n.º 10
0
    private void InitializePanelContent(string panelName, string previousPanelName)
    {
        switch (panelName)
        {
        case "RosterBuilderPanel":
            if (previousPanelName == "GameModeDecisionPanel")
            {
                RosterBuilder.Initialize();
            }
            break;

        case "OptionsPanel":
            Options.InitializePanel();
            break;

        case "ModsPanel":
            ModsManager.InitializePanel();
            break;

        case "BrowseRoomsPanel":
            Network.BrowseMatches();
            break;
        }
    }
Exemplo n.º 11
0
 public void Import()
 {
     RosterBuilder.CreateSquadFromImportedjson(GameObject.Find("UI/Panels/ImportExportPanel/InputField").GetComponent <InputField>().text, Players.PlayerNo.Player1);
 }
Exemplo n.º 12
0
 public void OnPlayerFactionChanged()
 {
     RosterBuilder.PlayerFactonChange();
 }
Exemplo n.º 13
0
 public void AddShip(int playerNo)
 {
     RosterBuilder.AddShip(Tools.IntToPlayer(playerNo));
 }
Exemplo n.º 14
0
 public void ImportSquadList()
 {
     RosterBuilder.ImportSquadList();
 }
Exemplo n.º 15
0
    public void RpcLoadBattleScene()
    {
        RosterBuilder.GeneratePlayersShipConfigurations();

        RosterBuilder.LoadBattleScene();
    }
Exemplo n.º 16
0
 public void ExportSquadList()
 {
     RosterBuilder.ExportSquadList(Players.PlayerNo.Player1);
 }
Exemplo n.º 17
0
 public void StartBattle()
 {
     RosterBuilder.StartGame();
 }