コード例 #1
0
ファイル: MainForm.cs プロジェクト: osler/WorldEditor
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FactionTemplateEntry ft = new FactionTemplateEntry
            {
                Id = DBCStores.FactionTemplate.MaxKey + 1,
                Faction = DBCStores.Faction.MaxKey + 1,
                FriendFaction = new uint[4] { 0, 0, 0, 0 },
                EnemyFaction = new uint[4] { 0, 0, 0, 0 },
            };
            DBCStores.FactionTemplate.AddEntry(ft.Id, ft);

            FactionEntry f = new FactionEntry
            {
                Id = DBCStores.Faction.MaxKey + 1,
                ReputationListId = DBCStores.Faction.Records.Max(p => p.ReputationListId),
                BaseRepRaceMask = new uint[] { 0, 0, 0, 0 },
                BaseRepClassMask = new uint[] { 0, 0, 0, 0 },
                BaseRepValue = new int[] { 0, 0, 0, 0 },
                ReputationFlags = new uint[] { 0, 0, 0, 0 },
                Name = "Nouvelle faction",
                Description = "",
            };

            listFactions.Items.Add(f);
            DBCStores.Faction.AddEntry(f.Id, f);

            listFactions.SelectedIndex = listFactions.Items.Count - 1;
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: osler/WorldEditor
        private void btnFctTplAdd_Click(object sender, EventArgs e)
        {
            FactionTemplateEntry f = new FactionTemplateEntry
            {
                Id = DBCStores.FactionTemplate.MaxKey + 1,
                Faction = UInt32.Parse(txtFactionId.Text),
                FriendFaction = new uint[4] { 0, 0, 0, 0 },
                EnemyFaction = new uint[4] { 0, 0, 0, 0 },
            };

            listFactionTemplate.Items.Add(f);
            DBCStores.FactionTemplate.AddEntry(f.Id, f);

            listFactionTemplate.SelectedIndex = listFactionTemplate.Items.Count - 1;
        }