Beispiel #1
0
        private void LoadItems(int baseOffset)
        {
            // Stored items
            StoredItems = new List <RBStoredItem>();
            var block = Bits.GetRange(Offsets.StoredItemOffset, Offsets.StoredItemCount * 10);

            for (int i = 0; i < Offsets.StoredItemCount; i++)
            {
                var quantity = block.GetNextInt(10);
                if (quantity > 0)
                {
                    StoredItems.Add(new RBStoredItem(i + 1, quantity));
                }
            }

            // Held Items
            HeldItems = new List <RBHeldItem>();

            // - Main Game
            for (int i = 0; i < 50; i++)
            {
                var item = new RBHeldItem(Bits.GetRange(baseOffset + Offsets.HeldItemOffset + (i * 33), 33));
                if (item.IsValid)
                {
                    HeldItems.Add(item);
                }
                else
                {
                    break;
                }
            }
        }
Beispiel #2
0
        public static object FromStoredItemParts(int itemID, int parameter)
        {
            var output = new RBHeldItem();

            output.IsValid   = true;
            output.ID        = itemID;
            output.Parameter = parameter;
            return(output);
        }
Beispiel #3
0
        public object Clone()
        {
            var output = new RBHeldItem();

            output.IsValid = this.IsValid;
            output.Flag1   = this.Flag1;
            output.Flag2   = this.Flag2;
            output.Flag3   = this.Flag3;
            output.Flag4   = this.Flag4;
            output.Flag5   = this.Flag5;
            output.Flag6   = this.Flag6;
            output.Flag7   = this.Flag7;

            output.Parameter = this.Parameter;

            output.ID = this.ID;

            return(output);
        }