Example #1
0
        public static Zone Factory(Game game, Torch.Object parent, string name)
        {
            var  data = ((SRPGGame)game).ZoneData.ContainsKey(name) ? ((SRPGGame)game).ZoneData[name] : new byte[] {};
            Zone zone;

            switch (name)
            {
            case "kakariko/village":
                zone = new Zones.Kakariko.Village(game, parent, data);
                break;

            case "kakariko/bombshop":
                zone = new Zones.Kakariko.Bombshop(game, parent, data);
                break;

            case "kakariko/inn":
                zone = new Zones.Kakariko.Inn(game, parent, data);
                break;

            case "village/village":
                zone = new Zones.Village.Village(game, parent, data);
                break;

            case "village/warehouse":
                zone = new Zones.Village.Warehouse(game, parent, data);
                break;

            case "village/inn":
                zone = new Zones.Village.Inn(game, parent, data);
                break;

            case "village/shop":
                zone = new Zones.Village.Shop(game, parent, data);
                break;

            case "coliseum/cell":
                zone = new Zones.Coliseum.Cell(game, parent, data);
                break;

            case "coliseum/halls-south":
                zone = new Zones.Coliseum.HallsSouth(game, parent, data);
                break;

            case "coliseum/halls-north":
                zone = new Zones.Coliseum.HallsNorth(game, parent, data);
                break;

            case "coliseum/halls-east":
                zone = new Zones.Coliseum.HallsEast(game, parent, data);
                break;

            default:
                throw new ZoneException(String.Format("Unable to generate unknown zone '{0}'.", name));
            }

            zone.Key = name;
            return(zone);
        }
Example #2
0
        public static Zone Factory(Game game, Torch.Object parent, string name)
        {
            var data = ((SRPGGame) game).ZoneData.ContainsKey(name) ? ((SRPGGame)game).ZoneData[name] : new byte[] {};
            Zone zone;

            switch(name)
            {
                case "kakariko/village":
                    zone =  new Zones.Kakariko.Village(game, parent, data);
                    break;
                case "kakariko/bombshop":
                    zone =  new Zones.Kakariko.Bombshop(game, parent, data);
                    break;
                case "kakariko/inn":
                    zone =  new Zones.Kakariko.Inn(game, parent, data);
                    break;

                case "village/village":
                    zone =  new Zones.Village.Village(game, parent, data);
                    break;
                case "village/warehouse":
                    zone =  new Zones.Village.Warehouse(game, parent, data);
                    break;
                case "village/inn":
                    zone =  new Zones.Village.Inn(game, parent, data);
                    break;
                case "village/shop":
                    zone = new Zones.Village.Shop(game, parent, data);
                    break;

                case "coliseum/cell":
                    zone =  new Zones.Coliseum.Cell(game, parent, data);
                    break;
                case "coliseum/halls-south":
                    zone =  new Zones.Coliseum.HallsSouth(game, parent, data);
                    break;
                case "coliseum/halls-north":
                    zone =  new Zones.Coliseum.HallsNorth(game, parent, data);
                    break;
                case "coliseum/halls-east":
                    zone =  new Zones.Coliseum.HallsEast(game, parent, data);
                    break;

                default:
                    throw new ZoneException(String.Format("Unable to generate unknown zone '{0}'.", name));
            }

            zone.Key = name;
            return zone;
        }