コード例 #1
0
        /// <summary>
        /// Use this to load a FestivalElement from a SaveFE
        /// </summary>
        /// <param name="savedFE">SaveFE to be loaded</param>
        /// <returns>The FestivalElement which was saved</returns>
        FestivalElement LoadFE(SaveableFE savedFE)
        {
            FestivalElement lfe;

            switch (savedFE.FEType)
            {
            case "Square":
                lfe = new Square(Brushes.Black, 1, 1);
                break;

            case "Triangle":
                lfe = new Triangle(Brushes.Black, 1, 1);
                break;

            case "Bush":
                lfe = new Bush(Brushes.Black, 1, 1);
                break;

            case "Stage":
                lfe = new Stage(Brushes.Black, 1, 1);
                break;

            case "BeerTent":
                lfe = new BeerTent(Brushes.Black, 1, 1);
                break;

            case "Bin":
                lfe = new Bin(Brushes.Black, 1, 1);
                break;

            case "CampingZone":
                lfe = new CampingZone(Brushes.Black, 1, 1);
                break;

            case "FairGround":
                lfe = new FairGround(Brushes.Black, 1, 1);
                break;

            case "FoodTent":
                lfe = new FoodTent(Brushes.Black, 1, 1);
                break;

            case "Shop":
                lfe = new Shop(Brushes.Black, 1, 1);
                break;

            case "Toilet":
                lfe = new Toilet(Brushes.Black, 1, 1);
                break;

            default:
                lfe = new Bush(Brushes.Black, 1, 1);
                break;
            }
            lfe.LoadData(savedFE);
            lfe.RenderTransform = lfe.GetTransform();
            return(lfe);
        }