示例#1
0
        public static IElementType GetTypeObject(Type ressType)
        {
            IElementType result = null;

            switch (ressType)
            {
            case Type.RESSOURCE_FOREST:
                result = new ForestElementType();
                break;

            case Type.RESSOURCE_STONE:
                result = new StoneElementType();
                break;

            case Type.RESSOURCE_IRON:
                result = new IronElementType();
                break;

            case Type.RESSOURCE_WATER:
                result = new LakeElementType();
                break;

            case Type.RESSOURCE_FIELDS:
                result = new FieldsElementType();
                break;
            }
            return(result);
        }
示例#2
0
        public static IElementType GetElementFromType(string elementType)
        {
            IElementType newElement = null;

            switch (elementType)
            {
            case "RESSOURCE_FOREST":
                newElement = new ForestElementType();
                break;

            case "RESSOURCE_STONE":
                newElement = new StoneElementType();
                break;

            case "RESSOURCE_IRON":
                newElement = new IronElementType();
                break;

            case "RESSOURCE_WATER":
                newElement = new LakeElementType();
                break;

            case "RESSOURCE_FIELDS":
                newElement = new FieldsElementType();
                break;

            case "BUILDING_WOODCUTTER":
                newElement = new WoodcutterElementType();
                break;

            case "BUILDING_SAWMILL":
                newElement = new SawmillElementType();
                break;

            case "BUILDING_QUARRY":
                newElement = new QuarryElementType();
                break;

            case "BUILDING_STONEMASON":
                newElement = new StoneMasonElementType();
                break;

            case "BUILDING_IRONMINE":
                newElement = new IronMineElementType();
                break;

            case "BUILDING_FOUNDRY":
                newElement = new FoundryElementType();
                break;

            case "BUILDING_TOWNHALL":
                newElement = new TownHallElementType();
                break;

            case "BUILDING_FARM":
                newElement = new FarmElementType();
                break;

            case "BUILDING_MILL":
                newElement = new MillElementType();
                break;

            case "BUILDING_TOWNHOUSE":
                newElement = new TownhouseElementType();
                break;

            case "BUILDING_MARKETPLACE":
                newElement = new MarketplaceElementType();
                break;

            case "BUILDING_RESEARCH_CENTER":
                newElement = new ResearchCenterElementType();
                break;

            case "BUILDING_WAREHOUSE":
                newElement = new WarehouseElementType();
                break;

            case "BUILDING_BARRACK":
                newElement = new BarrackBuilding();
                break;

            case "BUILDING_CITYGUARD_HOUSE":
                newElement = new CityguardBuilding();
                break;

            case "BUILDING_TRAINING_GROUND":
                newElement = new TrainingGroundBuilding();
                break;

            case "BUILDING_STABLE":
                newElement = new StableBuilding();
                break;

            case "BUILDING_MOONGLOW_TOWER":
                newElement = new MoonglowTowerBuilding();
                break;
            }

            return(newElement);
        }
示例#3
0
        public static IElementType GetElementFromType(string elementType)
        {
            IElementType newElement = null;
            switch(elementType)
            {
                case "RESSOURCE_FOREST":
                    newElement = new ForestElementType();
                    break;
                case "RESSOURCE_STONE":
                    newElement = new StoneElementType();
                    break;
                case "RESSOURCE_IRON":
                    newElement = new IronElementType();
                    break;
                case "RESSOURCE_WATER":
                    newElement = new LakeElementType();
                    break;
                case "RESSOURCE_FIELDS":
                    newElement = new FieldsElementType();
                    break;
                case "BUILDING_WOODCUTTER":
                    newElement = new WoodcutterElementType();
                    break;
                case "BUILDING_SAWMILL":
                    newElement = new SawmillElementType();
                    break;
                case "BUILDING_QUARRY":
                    newElement = new QuarryElementType();
                    break;
                case "BUILDING_STONEMASON":
                    newElement = new StoneMasonElementType();
                    break;
                case "BUILDING_IRONMINE":
                    newElement = new IronMineElementType();
                    break;
                case "BUILDING_FOUNDRY":
                    newElement = new FoundryElementType();
                    break;
                case "BUILDING_TOWNHALL":
                    newElement = new TownHallElementType();
                    break;
                case "BUILDING_FARM":
                    newElement = new FarmElementType();
                    break;
                case "BUILDING_MILL":
                    newElement = new MillElementType();
                    break;
                case "BUILDING_TOWNHOUSE":
                    newElement = new TownhouseElementType();
                    break;
                case "BUILDING_MARKETPLACE":
                    newElement = new MarketplaceElementType();
                    break;
                case "BUILDING_RESEARCH_CENTER":
                    newElement = new ResearchCenterElementType();
                    break;
                case "BUILDING_WAREHOUSE":
                    newElement = new WarehouseElementType();
                    break;
                case "BUILDING_BARRACK":
                    newElement = new BarrackBuilding();
                    break;
                case "BUILDING_CITYGUARD_HOUSE":
                    newElement = new CityguardBuilding();
                    break;
                case "BUILDING_TRAINING_GROUND":
                    newElement = new TrainingGroundBuilding();
                    break;
                case "BUILDING_STABLE":
                    newElement = new StableBuilding();
                    break;
                case "BUILDING_MOONGLOW_TOWER":
                    newElement = new MoonglowTowerBuilding();
                    break;
            }

            return newElement;
        }
示例#4
0
 public static IElementType GetTypeObject(Type ressType)
 {
     IElementType result = null;
     switch (ressType)
     {
         case Type.RESSOURCE_FOREST:
             result = new ForestElementType();
             break;
         case Type.RESSOURCE_STONE:
             result = new StoneElementType();
             break;
         case Type.RESSOURCE_IRON:
             result = new IronElementType();
             break;
         case Type.RESSOURCE_WATER:
             result = new LakeElementType();
             break;
         case Type.RESSOURCE_FIELDS:
             result = new FieldsElementType();
             break;
     }
     return result;
 }