void Start()
        {
            this.board.LoadLayout(layout);
            var t1p1 = this.board.Spawn(playerPrefab, new BoardPosition(0, -2));
            var t1p2 = this.board.Spawn(playerPrefab, new BoardPosition(-2, 0));
            var t2p1 = this.board.Spawn(playerPrefab, new BoardPosition(0, 2));
            var t2p2 = this.board.Spawn(playerPrefab, new BoardPosition(2, 0));

            team1.Add(t1p1.gameObject);
            team1.Add(t1p2.gameObject);
            team2.Add(t2p1.gameObject);
            team2.Add(t2p2.gameObject);

            DoneLoadingEvent?.Invoke();
        }
Esempio n. 2
0
        } /* Model1LoadStart */

        static private void  Model2LoadStart(String _model2Name,
                                             bool _forceRebuild,
                                             DoneLoadingEvent _doneLoadingEvent
                                             )
        {
            model2Name = _model2Name;

            if (String.IsNullOrEmpty(model2Name))
            {
                return;
            }

            doneLoadingModel2Event = _doneLoadingEvent;

            model2LoadStatus = new TrainingModelStatus(_model2Name, _forceRebuild, Model2LoadCompletion);
            model2LoadStatus.Show();
        } /* Model1LoadStart */
Esempio n. 3
0
        } /* LoadConfiguration */

        public static void  SetModel1(String _model1Name,
                                      bool _forceRebuild,
                                      DoneLoadingEvent _doneLoadingEvent
                                      )
        {
            bool model1CurentlyLoading = false;

            BlockStart();

            if (model1LoadStatus != null)
            {
                model1CurentlyLoading = true;
            }
            else
            {
                if ((model1 != null) && (model1Name == _model1Name) && (!_forceRebuild))
                {
                    // We already have this model loaded;  there is nothing to do.
                    // But we still have to the call back to let it know that the model is loaded.
                    if (_doneLoadingEvent != null)
                    {
                        _doneLoadingEvent(model1);
                    }
                }
                else
                {
                    if (model1 != null)
                    {
                        model1 = null;
                        GC.Collect();
                    }
                    GC.Collect();

                    Model1LoadStart(_model1Name, _forceRebuild, _doneLoadingEvent);
                    SaveConfiguration();
                }
            }

            BlockEnd();

            if (model1CurentlyLoading)
            {
                MessageBox.Show("Can not set a new Model;  one is currently loading now.");
                return;
            }
        } /* SetModel1 */