Beispiel #1
0
        private void OnItemMenuClick(object sender, EventArgs e)
        {
            var menuItem = sender as ToolStripMenuItem;
            int index    = ItemMenu.Items.IndexOf(menuItem);

            ItemTypeToAdd   = (ItemTypeIndex)(index + 1);
            btnAddItem.Text = menuItem.Text;

            AddItem();
        }
Beispiel #2
0
        public static ItemType GetItemType(ItemTypeIndex index)
        {
            int i = (int)index;

            if (i < 0 || i > 0x0F)
            {
                throw new ArgumentException("Invalid ItemTypeIndex");
            }

            return(types[i]);
        }
Beispiel #3
0
        public override int GetIndex(ItemSeeker s)
        {
            ItemTypeIndex i = (ItemTypeIndex)(s.Data[s.itemOffset] & 0x0F);

            if (i == ItemTypeIndex.Mella)
            {
                return(0);
            }
            if (i == ItemTypeIndex.Rinkas)
            {
                return(1);
            }
            return(2);
        }
Beispiel #4
0
        static string GetItemDescription(ItemTypeIndex i)
        {
            switch (i)
            {
            case ItemTypeIndex.Nothing:
                return("None");

            case ItemTypeIndex.Enemy:
                return("Enemy");

            case ItemTypeIndex.PowerUp:
                return("Power Up");

            case ItemTypeIndex.Elevator:
                return("Elevator");

            case ItemTypeIndex.MotherBrain:
            case ItemTypeIndex.Mella:
            case ItemTypeIndex.Rinkas:
            case ItemTypeIndex.PalSwap:
            case ItemTypeIndex.Zebetite:
                return("Single Byte");

            case ItemTypeIndex.Door:
                return("Door");

            case ItemTypeIndex.Turret:
                return("Turret");

            case ItemTypeIndex.Unused_b:
            case ItemTypeIndex.Unused_c:
            case ItemTypeIndex.Unused_d:
            case ItemTypeIndex.Unused_e:
            case ItemTypeIndex.Unused_f:
                return("Unknown");

            default:
                return("Invalid");
            }
        }
Beispiel #5
0
 public Item3Data(ItemTypeIndex type) : base(type)
 {
 }
Beispiel #6
0
 public ItemSingleByteData(ItemTypeIndex type) : base(type)
 {
 }
Beispiel #7
0
 public virtual void LoadData(ItemSeeker data)
 {
     this.type       = data.ItemType;
     this.SpriteSlot = data.SpriteSlot;
 }
Beispiel #8
0
 public ItemData(ItemTypeIndex type)
 {
     this.type = type;
 }
Beispiel #9
0
 public static ItemType GetItemType(this ItemTypeIndex index)
 {
     return(ItemType.GetItemType(index));
 }
Beispiel #10
0
 private ItemType(ItemTypeIndex index, int netByteCount)
 {
     this.Index        = index;
     this.NetByteCount = netByteCount;
     this.Name         = index.ToString();
 }