Example #1
0
        public void Start()
        {
            _input_output.Output_line("");
            _input_output.Output_options(new List <string>
            {
                ReconConsts.Load_pending_csvs,
                "2. Do actual reconciliation."
            });

            string input = _input_output.Get_generic_input(ReconConsts.PendingOrReconciliate);

            switch (input)
            {
            case "1":
            {
                ISpreadsheetRepoFactory spreadsheet_factory = new FakeSpreadsheetRepoFactory();
                var path        = new PathSetter(_input_output, spreadsheet_factory).Set_path();
                var file_loader = new FileLoader(_input_output);
                file_loader.Create_pending_csvs(path);
            }
            break;

            case "2":
            {
                Do_actual_reconciliation();
            }
            break;
            }
        }
        public Game(string[] playersNames, string mapName, GameSettings settings)
        {
            if (playersNames.Count() < GlobalConst.MinNumberOfPlayers || playersNames.Count() > GlobalConst.MaxNumberOfPlayers)
            {
                throw new ArgumentException(string.Format(
                                                "The number of players must be between {0} and {1}!",
                                                GlobalConst.MinNumberOfPlayers,
                                                GlobalConst.MaxNumberOfPlayers));
            }

            this.GameTimer       = new GameTimer(this, settings.GameDurationMinutes, settings.TurnDurationSeconds);
            this.currPlayerMoved = false;
            this.Pause           = false;

            this.Map     = GameMap.GetMapByName(mapName);
            this.Players = new List <Player>();
            this.InitializePlayers(playersNames, this.Players, this.Map.Start);
            this.CurrPlayer = this.Players[0];
            this.Dice       = Dice.Instance;
            this.Dice.Reset();
            this.Messages          = GameMessages.Instance;
            this.pathSetter        = new PathSetter(this);
            this.disasterGenerator = new DisasterGenerator(this.Map);
            this.disasterGenerator.SetConditions();
        }
Example #3
0
 public void Create_pending_csvs()
 {
     try
     {
         ISpreadsheetRepoFactory spreadsheet_factory = new FakeSpreadsheetRepoFactory();
         var path = new PathSetter(_input_output, spreadsheet_factory).Set_path();
         var pending_csv_file_creator = new PendingCsvFileCreator(path);
         pending_csv_file_creator.Create_and_populate_all_csvs();
     }
     catch (Exception e)
     {
         _input_output.Output_line(e.Message);
     }
 }
Example #4
0
 static void ReferenceInstance()
 {
     if (instance == null)
     {
         instance = FindObjectOfType <PathSetter>();
         if (instance != null)
         {
             Debug.Log("Succesfully referenced : " + instance.name);
         }
         else
         {
             Debug.Log("Cannot find a PathSetter in the scene");
         }
     }
     else
     {
         Debug.Log("Already have a path setter referenced");
     }
 }
Example #5
0
        private void Do_matching(ISpreadsheetRepoFactory spreadsheet_factory)
        {
            var main_file_paths = new PathSetter(_input_output, spreadsheet_factory).Set_path_and_file_names();

            main_file_paths.Matcher.Do_matching(main_file_paths, spreadsheet_factory);
        }