コード例 #1
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static long?GetProperty(this Weenie weenie, PropertyInt64 property)
 {
     return(weenie.WeeniePropertiesInt64.FirstOrDefault(x => x.Type == (uint)property)?.Value);
 }
コード例 #2
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static string GetProperty(this Weenie weenie, PropertyString property)
 {
     return(weenie.WeeniePropertiesString.FirstOrDefault(x => x.Type == (uint)property)?.Value);
 }
コード例 #3
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static double?GetProperty(this Weenie weenie, PropertyFloat property)
 {
     return(weenie.WeeniePropertiesFloat.FirstOrDefault(x => x.Type == (ushort)property)?.Value);
 }
コード例 #4
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static uint?GetProperty(this Weenie weenie, PropertyInstanceId property)
 {
     return(weenie.WeeniePropertiesIID.FirstOrDefault(x => x.Type == (uint)property)?.Value);
 }
コード例 #5
0
ファイル: WeenieExtensions.cs プロジェクト: zarlant/ACE
 public static WeeniePropertiesAttribute GetAttribute(this Weenie weenie, PropertyAttribute attribute)
 {
     return(weenie.WeeniePropertiesAttribute.FirstOrDefault(x => x.Type == (uint)attribute));
 }
コード例 #6
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
        // =====================================
        // Get
        // Bool, DID, Float, IID, Int, Int64, String, Position
        // =====================================

        public static bool?GetProperty(this Weenie weenie, PropertyBool property)
        {
            return(weenie.WeeniePropertiesBool.FirstOrDefault(x => x.Type == (uint)property)?.Value);
        }
コード例 #7
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesBodyPart GetBodyPart(this Weenie weenie, ushort key)
 {
     return(weenie.WeeniePropertiesBodyPart.FirstOrDefault(x => x.Key == key));
 }
コード例 #8
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static uint?GetAnimationId(this Weenie weenie, byte index)
 {
     return(weenie.WeeniePropertiesAnimPart.FirstOrDefault(x => x.Index == index)?.AnimationId);
 }
コード例 #9
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesEventFilter GetEventFilter(this Weenie weenie, int eventId)
 {
     return(weenie.WeeniePropertiesEventFilter.FirstOrDefault(x => x.Event == eventId));
 }
コード例 #10
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesAttribute2nd GetProperty(this Weenie weenie, PropertyAttribute2nd property)
 {
     return(weenie.WeeniePropertiesAttribute2nd.FirstOrDefault(x => x.Type == (uint)property));
 }
コード例 #11
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesEmote GetEmote(this Weenie weenie, uint category)
 {
     return(weenie.WeeniePropertiesEmote.FirstOrDefault(x => x.Category == category));
 }
コード例 #12
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesCreateList GetCreateList(this Weenie weenie, sbyte destinationType)
 {
     return(weenie.WeeniePropertiesCreateList.FirstOrDefault(x => x.DestinationType == destinationType));
 }
コード例 #13
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesTextureMap GetTextureMap(this Weenie weenie, byte index)
 {
     return(weenie.WeeniePropertiesTextureMap.FirstOrDefault(x => x.Index == index));
 }
コード例 #14
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesPosition GetProperty(this Weenie weenie, PositionType positionType)
 {
     return(weenie.WeeniePropertiesPosition.FirstOrDefault(x => x.PositionType == (uint)positionType));
 }
コード例 #15
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesSkill GetProperty(this Weenie weenie, Skill skill)
 {
     return(weenie.WeeniePropertiesSkill.FirstOrDefault(x => x.Type == (uint)skill));
 }
コード例 #16
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
        // =====================================
        // Set
        // Bool, DID, Float, IID, Int, Int64, String, Position
        // =====================================

        // todo

        // =====================================
        // Remove
        // Bool, DID, Float, IID, Int, Int64, String, Position
        // =====================================

        // todo


        // =====================================
        // Get
        // All Else
        // =====================================

        public static WeeniePropertiesSpellBook GetSpell(this Weenie weenie, int spell)
        {
            return(weenie.WeeniePropertiesSpellBook.FirstOrDefault(x => x.Spell == spell));
        }
コード例 #17
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesBookPageData GetBookPageData(this Weenie weenie, uint pageId)
 {
     return(weenie.WeeniePropertiesBookPageData.FirstOrDefault(x => x.PageId == pageId));
 }
コード例 #18
0
ファイル: WeenieExtensions.cs プロジェクト: jacobtipp/trACE
 public static WeeniePropertiesPalette GetPalette(this Weenie weenie, uint subPaletteId)
 {
     return(weenie.WeeniePropertiesPalette.FirstOrDefault(x => x.SubPaletteId == subPaletteId));
 }
コード例 #19
0
ファイル: WeenieExtensions.cs プロジェクト: zarlant/ACE
        public static Biota CreateCopyAsBiota(this Weenie weenie, uint id)
        {
            var biota = new Biota();

            biota.Id            = id;
            biota.WeenieClassId = weenie.ClassId;
            biota.WeenieType    = weenie.Type;

            if (weenie.WeeniePropertiesBook != null)
            {
                biota.BiotaPropertiesBook                    = new BiotaPropertiesBook();
                biota.BiotaPropertiesBook.ObjectId           = biota.Id;
                biota.BiotaPropertiesBook.MaxNumPages        = weenie.WeeniePropertiesBook.MaxNumPages;
                biota.BiotaPropertiesBook.MaxNumCharsPerPage = weenie.WeeniePropertiesBook.MaxNumCharsPerPage;
            }

            foreach (var value in weenie.WeeniePropertiesAnimPart)
            {
                biota.BiotaPropertiesAnimPart.Add(new BiotaPropertiesAnimPart
                {
                    ObjectId    = biota.Id,
                    Index       = value.Index,
                    AnimationId = value.AnimationId
                });
            }

            foreach (var value in weenie.WeeniePropertiesAttribute)
            {
                biota.BiotaPropertiesAttribute.Add(new BiotaPropertiesAttribute
                {
                    ObjectId    = biota.Id,
                    Type        = value.Type,
                    InitLevel   = value.InitLevel,
                    LevelFromCP = value.LevelFromCP,
                    CPSpent     = value.CPSpent,
                });
            }

            foreach (var value in weenie.WeeniePropertiesAttribute2nd)
            {
                biota.BiotaPropertiesAttribute2nd.Add(new BiotaPropertiesAttribute2nd
                {
                    ObjectId     = biota.Id,
                    Type         = value.Type,
                    InitLevel    = value.InitLevel,
                    LevelFromCP  = value.LevelFromCP,
                    CPSpent      = value.CPSpent,
                    CurrentLevel = value.CurrentLevel,
                });
            }

            foreach (var value in weenie.WeeniePropertiesBodyPart)
            {
                biota.BiotaPropertiesBodyPart.Add(new BiotaPropertiesBodyPart
                {
                    ObjectId        = biota.Id,
                    Key             = value.Key,
                    DType           = value.DType,
                    DVal            = value.DVal,
                    DVar            = value.DVar,
                    BaseArmor       = value.BaseArmor,
                    ArmorVsSlash    = value.ArmorVsSlash,
                    ArmorVsPierce   = value.ArmorVsPierce,
                    ArmorVsBludgeon = value.ArmorVsBludgeon,
                    ArmorVsCold     = value.ArmorVsCold,
                    ArmorVsFire     = value.ArmorVsFire,
                    ArmorVsAcid     = value.ArmorVsAcid,
                    ArmorVsElectric = value.ArmorVsElectric,
                    ArmorVsNether   = value.ArmorVsNether,
                    BH  = value.BH,
                    HLF = value.HLF,
                    MLF = value.MLF,
                    LLF = value.LLF,
                    HRF = value.HRF,
                    MRF = value.MRF,
                    LRF = value.LRF,
                    HLB = value.HLB,
                    MLB = value.MLB,
                    LLB = value.LLB,
                    HRB = value.HRB,
                    MRB = value.MRB,
                    LRB = value.LRB,
                });
            }

            foreach (var value in weenie.WeeniePropertiesBookPageData)
            {
                biota.BiotaPropertiesBookPageData.Add(new BiotaPropertiesBookPageData
                {
                    ObjectId      = biota.Id,
                    PageId        = value.PageId,
                    AuthorId      = value.AuthorId,
                    AuthorName    = value.AuthorName,
                    AuthorAccount = value.AuthorAccount,
                    IgnoreAuthor  = value.IgnoreAuthor,
                    PageText      = value.PageText,
                });
            }

            foreach (var value in weenie.WeeniePropertiesBool)
            {
                biota.BiotaPropertiesBool.Add(new BiotaPropertiesBool
                {
                    ObjectId = biota.Id,
                    Type     = value.Type,
                    Value    = value.Value,
                });
            }

            foreach (var value in weenie.WeeniePropertiesCreateList)
            {
                biota.BiotaPropertiesCreateList.Add(new BiotaPropertiesCreateList
                {
                    ObjectId        = biota.Id,
                    DestinationType = value.DestinationType,
                    WeenieClassId   = value.WeenieClassId,
                    StackSize       = value.StackSize,
                    Palette         = value.Palette,
                    Shade           = value.Shade,
                    TryToBond       = value.TryToBond,
                });
            }

            foreach (var value in weenie.WeeniePropertiesDID)
            {
                biota.BiotaPropertiesDID.Add(new BiotaPropertiesDID
                {
                    ObjectId = biota.Id,
                    Type     = value.Type,
                    Value    = value.Value,
                });
            }


            foreach (var value in weenie.WeeniePropertiesEmote)
            {
                var emote = new BiotaPropertiesEmote
                {
                    ObjectId      = biota.Id,
                    Category      = value.Category,
                    Probability   = value.Probability,
                    EmoteSetId    = value.EmoteSetId,
                    WeenieClassId = value.WeenieClassId,
                    Style         = value.Style,
                    Substyle      = value.Substyle,
                    Quest         = value.Quest,
                    VendorType    = value.VendorType,
                    MinHealth     = value.MinHealth,
                    MaxHealth     = value.MaxHealth,
                };

                biota.BiotaPropertiesEmote.Add(emote);
            }

            foreach (var value in weenie.WeeniePropertiesEmoteAction)
            {
                var action = new BiotaPropertiesEmoteAction
                {
                    ObjectId        = biota.Id,
                    EmoteCategory   = value.EmoteCategory,
                    EmoteSetId      = value.EmoteSetId,
                    Type            = value.Type,
                    Order           = value.Order,
                    Delay           = value.Delay,
                    Extent          = value.Extent,
                    Motion          = value.Motion,
                    Message         = value.Message,
                    TestString      = value.TestString,
                    Min             = value.Min,
                    Max             = value.Max,
                    Min64           = value.Min64,
                    Max64           = value.Max64,
                    MinDbl          = value.MinDbl,
                    MaxDbl          = value.MaxDbl,
                    Stat            = value.Stat,
                    Display         = value.Display,
                    Amount          = value.Amount,
                    Amount64        = value.Amount64,
                    HeroXP64        = value.HeroXP64,
                    Percent         = value.Percent,
                    SpellId         = value.SpellId,
                    WealthRating    = value.WealthRating,
                    TreasureClass   = value.TreasureClass,
                    TreasureType    = value.TreasureType,
                    PScript         = value.PScript,
                    Sound           = value.Sound,
                    DestinationType = value.DestinationType,
                    WeenieClassId   = value.WeenieClassId,
                    StackSize       = value.StackSize,
                    Palette         = value.Palette,
                    Shade           = value.Shade,
                    TryToBond       = value.TryToBond,
                    ObjCellId       = value.ObjCellId,
                    OriginX         = value.OriginX,
                    OriginY         = value.OriginY,
                    OriginZ         = value.OriginZ,
                    AnglesW         = value.AnglesW,
                    AnglesX         = value.AnglesX,
                    AnglesY         = value.AnglesY,
                    AnglesZ         = value.AnglesZ,
                };

                biota.BiotaPropertiesEmoteAction.Add(action);
            }


            foreach (var value in weenie.WeeniePropertiesEventFilter)
            {
                biota.BiotaPropertiesEventFilter.Add(new BiotaPropertiesEventFilter
                {
                    ObjectId = biota.Id,
                    Event    = value.Event,
                });
            }

            foreach (var value in weenie.WeeniePropertiesFloat)
            {
                biota.BiotaPropertiesFloat.Add(new BiotaPropertiesFloat
                {
                    ObjectId = biota.Id,
                    Type     = value.Type,
                    Value    = value.Value,
                });
            }

            foreach (var value in weenie.WeeniePropertiesGenerator)
            {
                biota.BiotaPropertiesGenerator.Add(new BiotaPropertiesGenerator
                {
                    ObjectId      = biota.Id,
                    Probability   = value.Probability,
                    WeenieClassId = value.WeenieClassId,
                    Delay         = value.Delay,
                    InitCreate    = value.InitCreate,
                    MaxCreate     = value.MaxCreate,
                    WhenCreate    = value.WhenCreate,
                    WhereCreate   = value.WhereCreate,
                    StackSize     = value.StackSize,
                    PaletteId     = value.PaletteId,
                    Shade         = value.Shade,
                    ObjCellId     = value.ObjCellId,
                    OriginX       = value.OriginX,
                    OriginY       = value.OriginY,
                    OriginZ       = value.OriginZ,
                    AnglesW       = value.AnglesW,
                    AnglesX       = value.AnglesX,
                    AnglesY       = value.AnglesY,
                    AnglesZ       = value.AnglesZ,
                });
            }

            foreach (var value in weenie.WeeniePropertiesIID)
            {
                biota.BiotaPropertiesIID.Add(new BiotaPropertiesIID
                {
                    ObjectId = biota.Id,
                    Type     = value.Type,
                    Value    = value.Value,
                });
            }

            foreach (var value in weenie.WeeniePropertiesInt)
            {
                biota.BiotaPropertiesInt.Add(new BiotaPropertiesInt
                {
                    ObjectId = biota.Id,
                    Type     = value.Type,
                    Value    = value.Value,
                });
            }

            foreach (var value in weenie.WeeniePropertiesInt64)
            {
                biota.BiotaPropertiesInt64.Add(new BiotaPropertiesInt64
                {
                    ObjectId = biota.Id,
                    Type     = value.Type,
                    Value    = value.Value,
                });
            }

            foreach (var value in weenie.WeeniePropertiesPalette)
            {
                biota.BiotaPropertiesPalette.Add(new BiotaPropertiesPalette
                {
                    ObjectId     = biota.Id,
                    SubPaletteId = value.SubPaletteId,
                    Offset       = value.Offset,
                    Length       = value.Length,
                });
            }

            foreach (var value in weenie.WeeniePropertiesPosition)
            {
                biota.BiotaPropertiesPosition.Add(new BiotaPropertiesPosition
                {
                    ObjectId     = biota.Id,
                    PositionType = value.PositionType,
                    ObjCellId    = value.ObjCellId,
                    OriginX      = value.OriginX,
                    OriginY      = value.OriginY,
                    OriginZ      = value.OriginZ,
                    AnglesW      = value.AnglesW,
                    AnglesX      = value.AnglesX,
                    AnglesY      = value.AnglesY,
                    AnglesZ      = value.AnglesZ,
                });
            }

            foreach (var value in weenie.WeeniePropertiesSkill)
            {
                biota.BiotaPropertiesSkill.Add(new BiotaPropertiesSkill
                {
                    ObjectId              = biota.Id,
                    Type                  = value.Type,
                    LevelFromPP           = value.LevelFromPP,
                    AdjustPP              = value.AdjustPP,
                    SAC                   = value.SAC,
                    PP                    = value.PP,
                    InitLevel             = value.InitLevel,
                    ResistanceAtLastCheck = value.ResistanceAtLastCheck,
                    LastUsedTime          = value.LastUsedTime,
                });
            }

            foreach (var value in weenie.WeeniePropertiesSpellBook)
            {
                biota.BiotaPropertiesSpellBook.Add(new BiotaPropertiesSpellBook
                {
                    ObjectId    = biota.Id,
                    Spell       = value.Spell,
                    Probability = value.Probability,
                });
            }

            foreach (var value in weenie.WeeniePropertiesString)
            {
                biota.BiotaPropertiesString.Add(new BiotaPropertiesString
                {
                    ObjectId = biota.Id,
                    Type     = value.Type,
                    Value    = value.Value,
                });
            }

            foreach (var value in weenie.WeeniePropertiesTextureMap)
            {
                biota.BiotaPropertiesTextureMap.Add(new BiotaPropertiesTextureMap
                {
                    ObjectId = biota.Id,
                    Index    = value.Index,
                    OldId    = value.OldId,
                    NewId    = value.NewId,
                });
            }

            return(biota);
        }