Beispiel #1
0
        public static GameObject Make(ObjectClassID ClassID, Action <string> LOGFUN = null)
        {
            GameObject ret = null;

            switch (ClassID)
            {
            case ObjectClassID.NONE:
                break;

            case ObjectClassID.DOG:
            {
                ret = new GameAnimal(LOGFUN)
                {
                    Name        = "小狗旺财",
                    Speed       = 0,
                    Description = "一只小狗,就是你",
                    CanPass     = false,
                    ClassID     = ClassID,
                    ImgFileID   = 1,
                    ImgID       = 0,
                    Status      = ObjectStatus.IDEL,
                    StatusStep  = 0,
                    OwnerEID    = null,
                    Inventory   = new GameObject[8]      //可以带8个物品
                };
            }
            break;

            case ObjectClassID.CAT:
            {
                ret = new GameAnimal(LOGFUN)
                {
                    Name        = "小猫咪咪",
                    Speed       = 10,
                    Description = "一只小猫,好可爱",
                    CanPass     = false,
                    ClassID     = ClassID,
                    ImgFileID   = 1,
                    ImgID       = 1,
                    Status      = ObjectStatus.IDEL,
                    StatusStep  = 0,
                    OwnerEID    = null,
                    Inventory   = new GameObject[8]      //可以带8个物品
                };
            }
            break;

            case ObjectClassID.GRASS:
                break;

            case ObjectClassID.ROCK:
                break;

            default:
                break;
            }
            return(ret);
        }
Beispiel #2
0
        void ReleaseDesignerOutlets()
        {
            if (ActionButton != null)
            {
                ActionButton.Dispose();
                ActionButton = null;
            }

            if (AddAuxiliaryClassesButton != null)
            {
                AddAuxiliaryClassesButton.Dispose();
                AddAuxiliaryClassesButton = null;
            }

            if (AddMandatoryAttributesButton != null)
            {
                AddMandatoryAttributesButton.Dispose();
                AddMandatoryAttributesButton = null;
            }

            if (AddObjectClassButton != null)
            {
                AddObjectClassButton.Dispose();
                AddObjectClassButton = null;
            }

            if (AddOptionalAttributesButton != null)
            {
                AddOptionalAttributesButton.Dispose();
                AddOptionalAttributesButton = null;
            }

            if (AuxiliaryClassesListView != null)
            {
                AuxiliaryClassesListView.Dispose();
                AuxiliaryClassesListView = null;
            }

            if (ClassTypePopup != null)
            {
                ClassTypePopup.Dispose();
                ClassTypePopup = null;
            }

            if (MandatoryAttributesButton != null)
            {
                MandatoryAttributesButton.Dispose();
                MandatoryAttributesButton = null;
            }

            if (MandatoryAttributesListView != null)
            {
                MandatoryAttributesListView.Dispose();
                MandatoryAttributesListView = null;
            }

            if (ObjectClassDescription != null)
            {
                ObjectClassDescription.Dispose();
                ObjectClassDescription = null;
            }

            if (GovernsIDField != null)
            {
                GovernsIDField.Dispose();
                GovernsIDField = null;
            }

            if (ObjectClassID != null)
            {
                ObjectClassID.Dispose();
                ObjectClassID = null;
            }

            if (ObjectClassName != null)
            {
                ObjectClassName.Dispose();
                ObjectClassName = null;
            }

            if (OptionalAttributesButton != null)
            {
                OptionalAttributesButton.Dispose();
                OptionalAttributesButton = null;
            }

            if (OptionalAttributesListView != null)
            {
                OptionalAttributesListView.Dispose();
                OptionalAttributesListView = null;
            }

            if (ParentClass != null)
            {
                ParentClass.Dispose();
                ParentClass = null;
            }

            if (RemoveAuxiliaryClassesButton != null)
            {
                RemoveAuxiliaryClassesButton.Dispose();
                RemoveAuxiliaryClassesButton = null;
            }

            if (RemoveMandatoryAttributesButton != null)
            {
                RemoveMandatoryAttributesButton.Dispose();
                RemoveMandatoryAttributesButton = null;
            }

            if (RemoveOptionalAttributesButton != null)
            {
                RemoveOptionalAttributesButton.Dispose();
                RemoveOptionalAttributesButton = null;
            }
        }