示例#1
0
        public static int IsParty(this StorageSlotFlag value)
        {
            if (value.HasFlagFast(StorageSlotFlag.Party1))
            {
                return(0);
            }
            if (value.HasFlagFast(StorageSlotFlag.Party2))
            {
                return(1);
            }
            if (value.HasFlagFast(StorageSlotFlag.Party3))
            {
                return(2);
            }
            if (value.HasFlagFast(StorageSlotFlag.Party4))
            {
                return(3);
            }
            if (value.HasFlagFast(StorageSlotFlag.Party5))
            {
                return(4);
            }
            if (value.HasFlagFast(StorageSlotFlag.Party6))
            {
                return(5);
            }

            return(-1);
        }
示例#2
0
        public static int IsBattleTeam(this StorageSlotFlag value)
        {
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam1))
            {
                return(0);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam2))
            {
                return(1);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam3))
            {
                return(2);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam4))
            {
                return(3);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam5))
            {
                return(4);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam6))
            {
                return(5);
            }

            return(-1);
        }
示例#3
0
        public static bool IsBattleTeam(this StorageSlotFlag value)
        {
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam1))
            {
                return(true);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam2))
            {
                return(true);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam3))
            {
                return(true);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam4))
            {
                return(true);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam5))
            {
                return(true);
            }
            if (value.HasFlagFast(StorageSlotFlag.BattleTeam6))
            {
                return(true);
            }

            return(false);
        }
示例#4
0
        public static bool IsOverwriteProtected(this StorageSlotFlag value)
        {
            if (value.HasFlagFast(StorageSlotFlag.Locked))
            {
                return(true);
            }

            if (value.HasFlagFast(StorageSlotFlag.Starter))
            {
                return(true);
            }

            return(value.IsBattleTeam() >= 0);
        }
示例#5
0
 public static bool HasFlagFast(this StorageSlotFlag value, StorageSlotFlag flag) => (value & flag) != 0;