コード例 #1
0
        /// <summary>
        /// Creates a new instance from the class specified in the <see cref="Class"/> property.
        /// </summary>
        /// <returns>New instance of the class.</returns>
        internal XObject InitiazeFromClass()
        {
            XClass cls = (XClass)this.FindGlobal(this.Class);

            if (cls == null)
            {
                throw new InvalidOperationException("Could not find class: " + this.Class);
            }

            var instance = cls.CreateInstance(this);

            instance.InitHierarchy();

            return(instance);
        }
コード例 #2
0
ファイル: LevelEngine.cs プロジェクト: valsavva/dynacat
		public override void Initialize()
		{
			// Initialize subcomponents
			base.Initialize();

			// Calculate points available on this level
			CountLevelPoints();

			// Make sure explosion class exists
			if (!string.IsNullOrEmpty(this.LevelInfo.ExplosionClass))
			{
				this.explosionClass = this.LevelObject.FindLocal(this.LevelInfo.ExplosionClass) as XClass;
				Debug.WriteLine("*** Explosion class could not be found: '{0}'", this.LevelInfo.ExplosionClass);
			}
			
			// Init waves
			this.waves = new Dictionary<GameEvent, RadioWave>();
		}