Exemplo n.º 1
0
        public ItemData(int Id, int Sprite, string Name, string PublicName, string Type, int Width, int Length, double Height, bool Stackable, bool Walkable, bool IsSeat,
                        bool AllowRecycle, bool AllowTrade, bool AllowMarketplaceSell, bool AllowGift, bool AllowInventoryStack, InteractionType InteractionType, int Modes,
                        string VendingIds, List <double> AdjustableHeights, int EffectId, int WiredId, bool IsRare, int ClothingId, bool ExtraRot)
        {
            this.Id                   = Id;
            this.SpriteId             = Sprite;
            this.ItemName             = Name;
            this.PublicName           = PublicName;
            this.Type                 = char.Parse(Type);
            this.Width                = Width;
            this.Length               = Length;
            this.Height               = Height;
            this.Stackable            = Stackable;
            this.Walkable             = Walkable;
            this.IsSeat               = IsSeat;
            this.AllowEcotronRecycle  = AllowRecycle;
            this.AllowTrade           = AllowTrade;
            this.AllowMarketplaceSell = AllowMarketplaceSell;
            this.AllowGift            = AllowGift;
            this.AllowInventoryStack  = AllowInventoryStack;
            this.InteractionType      = InteractionType;
            this.Modes                = Modes;
            this.VendingIds           = new List <int>();
            if (VendingIds.Contains(","))
            {
                foreach (string VendingId in VendingIds.Split(','))
                {
                    try
                    {
                        this.VendingIds.Add(int.Parse(VendingId));
                    }
                    catch
                    {
                        Console.WriteLine("Erro com item " + ItemName + ".");
                        continue;
                    }
                }
            }
            else if (!String.IsNullOrEmpty(VendingIds) && (int.Parse(VendingIds)) > 0)
            {
                this.VendingIds.Add(int.Parse(VendingIds));
            }

            this.AdjustableHeights = new Dictionary <string, double>();

            int count = 0;

            foreach (double eHeight in AdjustableHeights)
            {
                this.AdjustableHeights.Add(count.ToString(), eHeight);
                count++;
            }

            this.EffectId   = EffectId;
            this.WiredType  = WiredBoxTypeUtility.FromWiredId(WiredId);
            this.IsRare     = IsRare;
            this.ClothingId = ClothingId;
            this.ExtraRot   = ExtraRot;
        }
Exemplo n.º 2
0
        public ItemData(int Id, int Sprite, string Name, string PublicName, string Type, int Width, int Length, double Height, bool Stackable, bool Walkable, bool IsSeat,
                        bool AllowRecycle, bool AllowTrade, bool AllowMarketplaceSell, bool AllowGift, bool AllowInventoryStack, InteractionType InteractionType, int behaviourData, int Modes,
                        string VendingIds, string AdjustableHeights, int EffectId, int WiredId, bool IsRare, int ClothingId, bool ExtraRot)
        {
            this.Id                   = Id;
            SpriteId                  = Sprite;
            ItemName                  = Name;
            this.PublicName           = PublicName;
            this.Type                 = char.Parse(Type);
            this.Width                = Width;
            this.Length               = Length;
            this.Height               = Height;
            this.Stackable            = Stackable;
            this.Walkable             = Walkable;
            this.IsSeat               = IsSeat;
            AllowEcotronRecycle       = AllowRecycle;
            this.AllowTrade           = AllowTrade;
            this.AllowMarketplaceSell = AllowMarketplaceSell;
            this.AllowGift            = AllowGift;
            this.AllowInventoryStack  = AllowInventoryStack;
            this.InteractionType      = InteractionType;
            BehaviourData             = behaviourData;
            this.Modes                = Modes;
            this.VendingIds           = new List <int>();
            if (VendingIds.Contains(","))
            {
                foreach (string VendingId in VendingIds.Split(','))
                {
                    try
                    {
                        this.VendingIds.Add(int.Parse(VendingId));
                    }
                    catch
                    {
                        Console.WriteLine("Error with Item " + ItemName + " - Vending Ids");
                        continue;
                    }
                }
            }
            else if (!String.IsNullOrEmpty(VendingIds) && (int.Parse(VendingIds)) > 0)
            {
                this.VendingIds.Add(int.Parse(VendingIds));
            }

            this.AdjustableHeights = new List <double>();
            if (AdjustableHeights.Contains(","))
            {
                foreach (string H in AdjustableHeights.Split(','))
                {
                    this.AdjustableHeights.Add(double.Parse(H));
                }
            }
            else if (!String.IsNullOrEmpty(AdjustableHeights) && (double.Parse(AdjustableHeights)) > 0)
            {
                this.AdjustableHeights.Add(double.Parse(AdjustableHeights));
            }

            int wiredId = 0;

            if (this.InteractionType == InteractionType.WIRED_CONDITION || this.InteractionType == InteractionType.WIRED_TRIGGER || this.InteractionType == InteractionType.WIRED_EFFECT)
            {
                wiredId = WiredId;
            }

            this.EffectId   = EffectId;
            WiredType       = WiredBoxTypeUtility.FromWiredId(wiredId);
            this.IsRare     = IsRare;
            this.ClothingId = ClothingId;
            this.ExtraRot   = ExtraRot;
        }
Exemplo n.º 3
0
        public ItemData(int id,
                        int sprite,
                        string name,
                        string publicName,
                        string type,
                        int width,
                        int length,
                        double height,
                        bool stackable,
                        bool walkable,
                        bool isSeat,
                        bool allowRecycle,
                        bool allowTrade,
                        bool allowMarketplaceSell,
                        bool allowGift,
                        bool allowInventoryStack,
                        InteractionType interactionType,
                        int behaviourData,
                        int modes,
                        string vendingIds,
                        string adjustableHeights,
                        int effectId,
                        bool isRare,
                        bool extraRot)
        {
            Id                   = id;
            SpriteId             = sprite;
            ItemName             = name;
            PublicName           = publicName;
            Type                 = char.Parse(type);
            Width                = width;
            Length               = length;
            Height               = height;
            Stackable            = stackable;
            Walkable             = walkable;
            IsSeat               = isSeat;
            AllowEcotronRecycle  = allowRecycle;
            AllowTrade           = allowTrade;
            AllowMarketplaceSell = allowMarketplaceSell;
            AllowGift            = allowGift;
            AllowInventoryStack  = allowInventoryStack;
            InteractionType      = interactionType;
            BehaviourData        = behaviourData;
            Modes                = modes;
            VendingIds           = new List <int>();
            if (vendingIds.Contains(","))
            {
                foreach (var vendingId in vendingIds.Split(','))
                {
                    try
                    {
                        VendingIds.Add(int.Parse(vendingId));
                    }
                    catch
                    {
                        Console.WriteLine("Error with Item " + ItemName + " - Vending Ids");
                    }
                }
            }
            else if (!string.IsNullOrEmpty(vendingIds) && int.Parse(vendingIds) > 0)
            {
                VendingIds.Add(int.Parse(vendingIds));
            }

            AdjustableHeights = new List <double>();
            if (adjustableHeights.Contains(","))
            {
                foreach (var h in adjustableHeights.Split(','))
                {
                    AdjustableHeights.Add(double.Parse(h));
                }
            }
            else if (!string.IsNullOrEmpty(adjustableHeights) && double.Parse(adjustableHeights) > 0)
            {
                AdjustableHeights.Add(double.Parse(adjustableHeights));
            }

            EffectId = effectId;
            var wiredId = 0;

            if (InteractionType == InteractionType.WiredCondition ||
                InteractionType == InteractionType.WiredTrigger ||
                InteractionType == InteractionType.WiredEffect)
            {
                wiredId = BehaviourData;
            }
            WiredType = WiredBoxTypeUtility.FromWiredId(wiredId);
            IsRare    = isRare;
            ExtraRot  = extraRot;
        }