Beispiel #1
0
 public Minefield(IMovementFactory movementFactory, Tile[,] board, Mine[] mines, ExitPoint exitPoint, IDancer turtle)
 {
     this.movementFactory = movementFactory;
     this.board           = board;
     this.mines           = mines;
     this.exitPoint       = exitPoint;
     this.turtle          = turtle;
 }
Beispiel #2
0
        public void SelectDancer(string typeName)
        {
            Logger.Instance.Log(LogType.Info, "踊り手選択: " + typeName);
            if (_typeNameTable.ContainsKey(typeName))
            {
                Config.Instance.DancerTypeName = typeName;

                Type t = _typeNameTable[typeName];
                object o = Activator.CreateInstance(t);
                if (_dancer != null)
                {
                    Dictionary<string, string> dc = Config.Instance.GetDancerConfig(_dancer.TypeName);
                    _dancer.ConvertToDic(ref dc);
                    _dancer.Dispose();
                }
                _dancer = o as IDancer;
                Canvas c = (App.Current.MainWindow as MainWindow).canvas;
                Dictionary<string, string> ndc = Config.Instance.GetDancerConfig(_dancer.TypeName);
                _dancer.ConvertFromDic(ref ndc);
                _dancer.Init(c);

                Config.Instance.Save();

                (App.Current.MainWindow as MainWindow).AdjustWindowPosition();

                if (_menuItems != null)
                {
                    foreach (MenuItem mi in _menuItems)
                    {
                        mi.IsChecked = (string)mi.Tag == typeName;
                    }
                }
            }
        }