Пример #1
0
        public MapTabEffectsViewModel()
        {
            Statuses = new CollectionBoxViewModel(new StringConv(typeof(MapStatus), new object[0]));
            Statuses.OnMemberChanged += Statuses_Changed;
            Statuses.OnEditItem      += Statuses_EditItem;

            MapEffect = new ClassBoxViewModel(new StringConv(typeof(ActiveEffect), new object[0]));
            MapEffect.OnMemberChanged += MapEffect_Changed;
            MapEffect.OnEditItem      += MapEffect_Edit;

            CheckEvents = new CollectionBoxViewModel(new StringConv(typeof(SingleCharEvent), new object[0]));
            CheckEvents.OnMemberChanged += CheckEvents_Changed;
            CheckEvents.OnEditItem      += Events_EditItem;
        }
        public MapTabTilesViewModel()
        {
            TileTypes = new ObservableCollection <string>();
            string[] tile_names = DataManager.Instance.DataIndices[DataManager.DataType.Tile].GetLocalStringArray();
            for (int ii = 0; ii < tile_names.Length; ii++)
            {
                TileTypes.Add(ii.ToString("D3") + ": " + tile_names[ii]);
            }

            Owners = new ObservableCollection <string>();
            for (int ii = 0; ii < 3; ii++)
            {
                Owners.Add(((EffectTile.TileOwner)ii).ToString());
            }


            TileStates             = new CollectionBoxViewModel(new StringConv(typeof(TileState), new object[0]));
            TileStates.OnEditItem += TileStates_EditItem;
        }
        public MapTabEntitiesViewModel()
        {
            MonsterTeam team = new MonsterTeam();

            SelectedEntity        = new Character(new CharData(), team);
            SelectedEntity.Level  = 1;
            SelectedEntity.Tactic = new AITactic(DataManager.Instance.GetAITactic(0));
            team.Players.Add(SelectedEntity);

            Directions = new ObservableCollection <string>();
            foreach (Dir8 dir in DirExt.VALID_DIR8)
            {
                Directions.Add(dir.ToLocal());
            }

            Tactics = new ObservableCollection <string>();
            string[] tactic_names = DataManager.Instance.DataIndices[DataManager.DataType.AI].GetLocalStringArray();
            for (int ii = 0; ii < tactic_names.Length; ii++)
            {
                Tactics.Add(ii.ToString("D2") + ": " + tactic_names[ii]);
            }

            Monsters = new ObservableCollection <string>();
            string[] monster_names = DataManager.Instance.DataIndices[DataManager.DataType.Monster].GetLocalStringArray();
            for (int ii = 0; ii < monster_names.Length; ii++)
            {
                Monsters.Add(ii.ToString("D3") + ": " + monster_names[ii]);
            }

            Forms = new ObservableCollection <string>();

            Skins = new ObservableCollection <string>();
            string[] skin_names = DataManager.Instance.DataIndices[DataManager.DataType.Skin].GetLocalStringArray();
            for (int ii = 0; ii < DataManager.Instance.DataIndices[DataManager.DataType.Skin].Count; ii++)
            {
                Skins.Add(skin_names[ii]);
            }

            Genders = new ObservableCollection <string>();
            for (int ii = 0; ii <= (int)Gender.Female; ii++)
            {
                Genders.Add(((Gender)ii).ToLocal());
            }

            Intrinsics = new ObservableCollection <string>();
            string[] intrinsic_names = DataManager.Instance.DataIndices[DataManager.DataType.Intrinsic].GetLocalStringArray();
            for (int ii = 0; ii < intrinsic_names.Length; ii++)
            {
                Intrinsics.Add(ii.ToString("D3") + ": " + intrinsic_names[ii]);
            }

            Equips = new ObservableCollection <string>();
            Equips.Add("---: None");
            string[] item_names = DataManager.Instance.DataIndices[DataManager.DataType.Item].GetLocalStringArray();
            for (int ii = 0; ii < item_names.Length; ii++)
            {
                Equips.Add(ii.ToString("D3") + ": " + item_names[ii]);
            }

            Skills = new ObservableCollection <string>();
            Skills.Add("---: None");
            string[] skill_names = DataManager.Instance.DataIndices[DataManager.DataType.Skill].GetLocalStringArray();
            for (int ii = 0; ii < skill_names.Length; ii++)
            {
                Skills.Add(ii.ToString("D3") + ": " + skill_names[ii]);
            }

            speciesChanged();

            Statuses = new CollectionBoxViewModel(new StringConv(typeof(StatusEffect), new object[0]));
            Statuses.OnMemberChanged += Statuses_Changed;
            Statuses.OnEditItem      += Statuses_EditItem;
        }