Пример #1
0
        /// <summary>
        /// Create an area.
        /// </summary>
        /// <param name="areaGroup">
        /// The <see cref="AreaGroup"/> this area will belong in.
        /// </param>
        public Area(AreaGroup areaGroup)
        {
            this.areaGroup = areaGroup;

            drawerInformation = new Drawer.Information();

            canFocus       = false;
            dpb            = 0;
            fixedBpr       = -1;
            isAreaRealized = false;
        }
Пример #2
0
        /// <summary>
        /// Factory method to create instances of area types by name.
        /// </summary>
        /// <param name="name">
        /// The name of the type of the area to create.
        /// </param>
        /// <param name="ag">
        /// The <see cref="AreaGroup"/> this area will belong in.
        /// </param>
        /// <returns>
        /// The created area.
        /// </returns>
        static public Area Factory(string name, AreaGroup ag)
        {
            try {
                AreaCreatorFunc acf = pluginTable[name];
                return(acf(ag));
            }
            catch (KeyNotFoundException e) {
                System.Console.WriteLine(e.Message);
            }

            return(null);
        }