コード例 #1
0
ファイル: OtItem.cs プロジェクト: joseamaya1/SharpMapTracker
        public static OtItem Create(OtItemType type)
        {
            OtItem item = null;

            if (type.Group == OtItemGroup.Depot)
            {
                item = new OtDepot(type);
            }
            else if (type.Group == OtItemGroup.Container)
            {
                item = new OtContainer(type);
            }
            else if (type.Group == OtItemGroup.Teleport)
            {
                item = new OtTeleport(type);
            }
            else if (type.Group == OtItemGroup.MagicField)
            {
                item = new OtMagicField(type);
            }
            else if (type.Group == OtItemGroup.Door)
            {
                item = new OtDoor(type);
            }
            else if (type.Group == OtItemGroup.TrashHolder)
            {
                item = new OtTrashHolder(type);
            }
            else if (type.Group == OtItemGroup.MailBox)
            {
                item = new OtMailBox(type);
            }
            else
            {
                item = new OtItem(type);
            }

            return(item);
        }
コード例 #2
0
        public static OtItem Create(OtItemType type)
        {
            OtItem item = null;

            if (type.Group == OtItemGroup.Depot)
                item = new OtDepot(type);
            else if (type.Group == OtItemGroup.Container)
                item = new OtContainer(type);
            else if (type.Group == OtItemGroup.Teleport)
                item = new OtTeleport(type);
            else if (type.Group == OtItemGroup.MagicField)
                item = new OtMagicField(type);
            else if (type.Group == OtItemGroup.Door)
                item = new OtDoor(type);
            else if (type.Group == OtItemGroup.TrashHolder)
                item = new OtTrashHolder(type);
            else if (type.Group == OtItemGroup.MailBox)
                item = new OtMailBox(type);
            else
                item = new OtItem(type);

            return item;
        }