예제 #1
0
        private static bool CheckDest(SlotViewInfo <PictureBox> info, SaveFile sav, PKM pk)
        {
            var msg = info.Slot.CanWriteTo(sav, pk);

            if (msg == WriteBlockedMessage.None)
            {
                return(true);
            }

            switch (msg)
            {
            case WriteBlockedMessage.InvalidPartyConfiguration:
                WinFormsUtil.Alert(MsgSaveSlotEmpty);
                break;

            case WriteBlockedMessage.IncompatibleFormat:
                break;

            case WriteBlockedMessage.InvalidDestination:
                WinFormsUtil.Alert(MsgSaveSlotLocked);
                break;

            default:
                throw new IndexOutOfRangeException(nameof(msg));
            }
            return(false);
        }
예제 #2
0
 private bool Equals(SlotViewInfo <T> other)
 {
     if (other.View.SAV != View.SAV)
     {
         return(false);
     }
     if (other.View.ViewIndex != View.ViewIndex)
     {
         return(false);
     }
     if (other.Slot.Slot != Slot.Slot)
     {
         return(false);
     }
     return(other.Slot.GetType() == Slot.GetType());
 }