private void PopulateStoryCollection()
        {
            StoryCollection = new BindableCollection <StoryCollection>();
            var forgeDatabase       = Global.Instance.ForgeDatabase();
            var tempStoryCollection = new BindableCollection <StoryCollection>();


            foreach (var story in forgeDatabase.Stories)
            {
                tempStoryCollection.Add(new StoryCollection
                {
                    ID          = story.ID,
                    Name        = story.Name,
                    Author      = story.Author,
                    Created     = story.Created,
                    Type        = story.Type,
                    Description = story.Description
                });
            }


            if (tempStoryCollection.SequenceEqual(Global.Instance.StoryCollection))
            {
                StoryCollection = new BindableCollection <StoryCollection>(tempStoryCollection);
            }
            else
            {
                Global.Instance.StoryCollection = new BindableCollection <StoryCollection>(tempStoryCollection);
                StoryCollection = new BindableCollection <StoryCollection>(tempStoryCollection);
            }
        }
        private void PopulateFactionCollection()
        {
            var forgeDatabase         = Global.Instance.ForgeDatabase();
            var tempFactionCollection = new BindableCollection <FactionCollection>();

            foreach (var faction in forgeDatabase.Factions)
            {
                tempFactionCollection.Add(new FactionCollection
                {
                    ID          = faction.ID,
                    Name        = faction.Name,
                    Description = faction.Description
                });
            }

            if (tempFactionCollection.SequenceEqual(Global.Instance.FactionCollection))
            {
                FactionCollection = new BindableCollection <FactionCollection>(tempFactionCollection);
            }
            else
            {
                Global.Instance.FactionCollection = new BindableCollection <FactionCollection>(tempFactionCollection);
                FactionCollection = new BindableCollection <FactionCollection>(tempFactionCollection);
            }
        }
        private void PopulateSkillCollection()
        {
            var forgeDatabase       = Global.Instance.ForgeDatabase();
            var tempSkillCollection = new BindableCollection <SkillCollection>();

            foreach (var skill in forgeDatabase.Skills)
            {
                tempSkillCollection.Add(new SkillCollection
                {
                    ID          = skill.ID,
                    Name        = skill.Name,
                    Description = skill.Description
                });
            }

            if (tempSkillCollection.SequenceEqual(Global.Instance.SkillCollection))
            {
                SkillCollection = new BindableCollection <SkillCollection>(tempSkillCollection);
            }
            else
            {
                Global.Instance.SkillCollection = new BindableCollection <SkillCollection>(tempSkillCollection);
                SkillCollection = new BindableCollection <SkillCollection>(tempSkillCollection);
            }
        }
        private void PopulateSpellCollection()
        {
            var forgeDatabase       = Global.Instance.ForgeDatabase();
            var tempSpellCollection = new BindableCollection <SpellCollection>();

            foreach (var spell in forgeDatabase.Spells)
            {
                tempSpellCollection.Add(new SpellCollection
                {
                    ID               = spell.ID,
                    Name             = spell.Name,
                    School           = spell.School,
                    SubSchool        = spell.SubSchool,
                    Effect           = spell.Effect,
                    CastingTime      = spell.CastingTime,
                    Components       = spell.Components,
                    Range            = spell.Range,
                    Area             = spell.Area,
                    Targets          = spell.Targets,
                    Duration         = spell.Duration,
                    SavingThrow      = spell.SavingThrow,
                    SpellResistance  = spell.SpellResistance,
                    Description      = spell.Description,
                    Level            = spell.Level,
                    ShortDescription = spell.ShortDescription,
                    Domain           = spell.Domain
                });
            }

            if (!tempSpellCollection.SequenceEqual(Global.Instance.SpellCollection))
            {
                Global.Instance.SpellCollection = new BindableCollection <SpellCollection>(tempSpellCollection);
            }
        }
Example #5
0
        private void PopulateFeatCollection()
        {
            var forgeDatabase      = Global.Instance.ForgeDatabase();
            var tempFeatCollection = new BindableCollection <FeatCollection>();

            foreach (var feat in forgeDatabase.Feats)
            {
                tempFeatCollection.Add(new FeatCollection
                {
                    FeatID            = feat.ID,
                    FeatName          = feat.Name,
                    FeatDescription   = feat.Description,
                    FeatBenefit       = feat.Benefit,
                    FeatPrerequisites = feat.Prerequisites,
                    FeatSpecial       = feat.Special,
                    FeatType          = feat.Type,
                    FeatNormal        = feat.Normal
                });
            }

            if (!tempFeatCollection.SequenceEqual(Global.Instance.FeatCollection))
            {
                Global.Instance.FeatCollection = new BindableCollection <FeatCollection>(tempFeatCollection);
            }
        }
        private void PopulateLanguageCollection()
        {
            var forgeDatabase          = Global.Instance.ForgeDatabase();
            var tempLanguageCollection = new BindableCollection <LanguageCollection>();

            foreach (var language in forgeDatabase.Languages)
            {
                tempLanguageCollection.Add(new LanguageCollection
                {
                    ID          = language.ID,
                    Name        = language.Name,
                    Description = language.Description
                });
            }

            if (tempLanguageCollection.SequenceEqual(Global.Instance.LanguageCollection))
            {
                LanguageCollection = new BindableCollection <LanguageCollection>(tempLanguageCollection);
            }
            else
            {
                Global.Instance.LanguageCollection = new BindableCollection <LanguageCollection>(tempLanguageCollection);
                LanguageCollection = new BindableCollection <LanguageCollection>(tempLanguageCollection);
            }
        }
Example #7
0
        private void PopulateMapCollection()
        {
            try
            {
                var forgeDatabase     = Global.Instance.ForgeDatabase();
                var tempMapCollection = new BindableCollection <MapCollection>();

                foreach (var map in forgeDatabase.Maps)
                {
                    bool isBaseMap = false;

                    if (map.IsBaseMap == 0)
                    {
                        isBaseMap = false;
                    }

                    if (map.IsBaseMap == 1)
                    {
                        isBaseMap = true;
                    }

                    tempMapCollection.Add(new MapCollection
                    {
                        MapID       = map.ID,
                        StoryID     = map.StoryID,
                        ParentMapID = map.ParentID,
                        MapName     = map.Name,
                        MapPath     = map.Path,
                        MapWidth    = map.Width,
                        MapHeight   = map.Height,
                        IsBaseMap   = isBaseMap
                    });
                }

                if (tempMapCollection.SequenceEqual(Global.Instance.MapCollection))
                {
                    MapCollection = new BindableCollection <MapCollection>(tempMapCollection);
                }
                else
                {
                    Global.Instance.MapCollection = new BindableCollection <MapCollection>(tempMapCollection);
                    MapCollection = new BindableCollection <MapCollection>(tempMapCollection);
                }
            }
            catch { }
        }
Example #8
0
        private void PopulatePushPinCollection()
        {
            try
            {
                var forgeDatabase         = Global.Instance.ForgeDatabase();
                var tempPushPinCollection = new BindableCollection <PushPinCollection>();

                foreach (var pushPin in forgeDatabase.PushPins)
                {
                    bool hasMap = false;
                    if (pushPin.MapID != null || pushPin.MapID > 0)
                    {
                        hasMap = true;
                    }

                    tempPushPinCollection.Add(new PushPinCollection
                    {
                        PushPinID    = pushPin.ID,
                        LayerID      = pushPin.LayerID,
                        PushPinTop   = pushPin.Top,
                        PushPinLeft  = pushPin.Left,
                        PushPinName  = pushPin.Name,
                        PushPinColor = pushPin.Color,
                        MapID        = pushPin.MapID,
                        EncounterID  = pushPin.EncounterID,
                        EventID      = pushPin.EventID,
                        HasMap       = hasMap
                    });
                }

                if (tempPushPinCollection.SequenceEqual(Global.Instance.PushPinCollection))
                {
                    PushPinCollection = new BindableCollection <PushPinCollection>(tempPushPinCollection);
                }
                else
                {
                    Global.Instance.PushPinCollection = new BindableCollection <PushPinCollection>(tempPushPinCollection);
                    PushPinCollection = new BindableCollection <PushPinCollection>(tempPushPinCollection);
                }
            }
            catch
            { }
        }
Example #9
0
        private void PopulatePlayerCollection()
        {
            try
            {
                var forgeDatabase        = Global.Instance.ForgeDatabase();
                var tempPlayerCollection = new BindableCollection <PlayerCollection>();

                foreach (var player in forgeDatabase.Players.Where(x => x.StoryID == Global.Instance.StoryID))
                {
                    var playerFactions  = new BindableCollection <PlayerFactionCollection>();
                    var playerSkills    = new BindableCollection <PlayerSkillCollection>();
                    var playerLanguages = new BindableCollection <PlayerLanguageCollection>();

                    foreach (var faction in player.Factions)
                    {
                        playerFactions.Add(new PlayerFactionCollection
                        {
                            FactionName        = faction.Name,
                            FactionDescription = faction.Description,
                            FactionStatus      = faction.FactionStatus
                        });
                    }

                    foreach (var skill in forgeDatabase.PlayerSkills.Where(x => x.PlayerID == player.ID))
                    {
                        playerSkills.Add(new PlayerSkillCollection
                        {
                            SkillName        = skill.SKILL.Name,
                            SkillDescription = skill.SKILL.Description,
                            SkillRank        = skill.Rank
                        });
                    }

                    foreach (var language in player.Languages)
                    {
                        playerLanguages.Add(new PlayerLanguageCollection
                        {
                            LanguageName        = language.Name,
                            LanguageDescription = language.Description
                        });
                    }

                    tempPlayerCollection.Add(new PlayerCollection {
                        PlayerID      = player.ID,
                        StoryID       = player.StoryID,
                        PlayerName    = player.PlayerName,
                        CharacterName = player.CharacterName,
                        HitPoints     = player.HitPoints,
                        Alignment     = player.Alignment,
                        ArmorClass    = player.ArmorClass,
                        TouchAC       = player.TouchAC,
                        FlatFootedAC  = player.FlatFootedAC,
                        CMD           = player.CMD,
                        Fort          = player.Fort,
                        Ref           = player.Ref,
                        Will          = player.Will,
                        Str           = player.Str,
                        Dex           = player.Dex,
                        Con           = player.Con,
                        Int           = player.Int,
                        Wis           = player.Wis,
                        Cha           = player.Cha,
                        Factions      = new BindableCollection <PlayerFactionCollection>(playerFactions),
                        Skills        = new BindableCollection <PlayerSkillCollection>(playerSkills),
                        Languages     = new BindableCollection <PlayerLanguageCollection>(playerLanguages)
                    });
                }

                if (tempPlayerCollection.SequenceEqual(Global.Instance.PlayerCollection))
                {
                    PlayerCollection = new BindableCollection <PlayerCollection>(tempPlayerCollection);
                }
                else
                {
                    Global.Instance.PlayerCollection = new BindableCollection <PlayerCollection>(tempPlayerCollection);
                    PlayerCollection = new BindableCollection <PlayerCollection>(tempPlayerCollection);
                }
            }
            catch
            {
            }
        }
        private void PopulateBestiaryCollection()
        {
            var forgeDatabase          = Global.Instance.ForgeDatabase();
            var tempBestiaryCollection = new BindableCollection <BestiaryCollection>();

            foreach (var beast in forgeDatabase.Bestiary)
            {
                tempBestiaryCollection.Add(new BestiaryCollection
                {
                    ID           = beast.ID,
                    Name         = beast.Name,
                    CR           = beast.CR,
                    XP           = beast.XP,
                    Race         = beast.Race,
                    Class1       = beast.Class1,
                    Class1Level  = beast.Class1Level,
                    Class2       = beast.Class2,
                    Class2Level  = beast.Class2Level,
                    Alignment    = beast.Alignment,
                    Size         = beast.Size,
                    Type         = beast.Type,
                    SubType1     = beast.SubType1,
                    SubType2     = beast.SubType2,
                    SubType3     = beast.SubType3,
                    SubType4     = beast.SubType4,
                    SubType5     = beast.SubType5,
                    SubType6     = beast.SubType6,
                    AC           = beast.AC,
                    ACTouch      = beast.ACTouch,
                    ACFlatFooted = beast.ACFlatFooted,
                    HP           = beast.HP,
                    HD           = beast.HD,
                    Fort         = beast.Fort,
                    Ref          = beast.Ref,
                    Will         = beast.Will,
                    Melee        = beast.Melee,
                    Ranged       = beast.Ranged,
                    Reach        = beast.Reach,
                    Str          = beast.Str,
                    Dex          = beast.Dex,
                    Con          = beast.Con,
                    Int          = beast.Int,
                    Wis          = beast.Wis,
                    Cha          = beast.Cha,
                    Feats        = beast.Feats,
                    Skills       = beast.Skills,
                    RacialMods   = beast.RacialMods,
                    Languages    = beast.Languages,
                    SQ           = beast.SQ,
                    Environment  = beast.Environment,
                    Organization = beast.Organization,
                    Treasure     = beast.Treasure,
                    Group        = beast.Group,
                    Gear         = beast.Gear,
                    OtherGear    = beast.OtherGear,
                    Speed        = beast.Speed
                });
            }

            if (tempBestiaryCollection.SequenceEqual(Global.Instance.BestiaryCollection))
            {
                BestiaryCollection = new BindableCollection <BestiaryCollection>(tempBestiaryCollection);
            }
            else
            {
                Global.Instance.BestiaryCollection = new BindableCollection <BestiaryCollection>(tempBestiaryCollection);
                BestiaryCollection = new BindableCollection <BestiaryCollection>(tempBestiaryCollection);
            }
        }