Example #1
0
		public Base Build(String name, IO.TextSection section, String prefix)
		{
			if (name == null) throw new ArgumentNullException("name");
			if (section == null) throw new ArgumentNullException("section");
			if (prefix == null) throw new ArgumentNullException("prefix");

			DataMap datamap = new DataMap(section, prefix);

			Base element = null;

			switch (datamap.Type)
			{
				case ElementType.Animation:
					element = new AnimatedImage(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
					break;

				case ElementType.Static:
					element = new StaticImage(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
					break;

				case ElementType.Text:
					element = new Text(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
					break;

				case ElementType.None:
				default:
					element = new Base(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
					break;

			}

			m_elements.Add(element);
			return element;
		}
Example #2
0
		public Base(Collection collection, String name, DataMap datamap, Drawing.SpriteManager sprites, Animations.AnimationManager animations, Audio.SoundManager sounds)
		{
			if (collection == null) throw new ArgumentNullException("collection");
			if (name == null) throw new ArgumentNullException("name");
			if (datamap == null) throw new ArgumentNullException("datamap");
			if (sprites == null) throw new ArgumentNullException("sprites");
			if (animations == null) throw new ArgumentNullException("animations");
			if (sounds == null) throw new ArgumentNullException("sounds");

			m_collection = collection;
			m_name = name;
			m_data = datamap;
			m_spritemanager = sprites;
			m_animationmanager = animations.Clone();
			m_soundmanager = sounds;
		}
Example #3
0
        public Base Build(String name, IO.TextSection section, String prefix)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (section == null)
            {
                throw new ArgumentNullException("section");
            }
            if (prefix == null)
            {
                throw new ArgumentNullException("prefix");
            }

            DataMap datamap = new DataMap(section, prefix);

            Base element = null;

            switch (datamap.Type)
            {
            case ElementType.Animation:
                element = new AnimatedImage(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
                break;

            case ElementType.Static:
                element = new StaticImage(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
                break;

            case ElementType.Text:
                element = new Text(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
                break;

            case ElementType.None:
            default:
                element = new Base(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
                break;
            }

            m_elements.Add(element);
            return(element);
        }
Example #4
0
        public Base Build(string name, IO.TextSection section, string prefix)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (section == null)
            {
                throw new ArgumentNullException(nameof(section));
            }
            if (prefix == null)
            {
                throw new ArgumentNullException(nameof(prefix));
            }

            var datamap = new DataMap(section, prefix);

            Base element;

            switch (datamap.Type)
            {
            case ElementType.Animation:
                element = new AnimatedImage(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
                break;

            case ElementType.Static:
                element = new StaticImage(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
                break;

            case ElementType.Text:
                element = new Text(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
                break;

            default:
                element = new Base(this, name, datamap, SpriteManager, AnimationManager, SoundManager);
                break;
            }

            m_elements[element.Name] = element;
            return(element);
        }
Example #5
0
		public Text(Collection collection, String name, DataMap datamap, Drawing.SpriteManager sprites, Animations.AnimationManager animations, Audio.SoundManager sounds)
			: base(collection, name, datamap, sprites, animations, sounds)
		{
		}
Example #6
0
 public AnimatedImage(Collection collection, string name, DataMap datamap, Drawing.SpriteManager sprites, Animations.AnimationManager animations, Audio.SoundManager sounds)
     : base(collection, name, datamap, sprites, animations, sounds)
 {
     Reset();
 }
Example #7
0
 public Text(Collection collection, String name, DataMap datamap, Drawing.SpriteManager sprites, Animations.AnimationManager animations, Audio.SoundManager sounds)
     : base(collection, name, datamap, sprites, animations, sounds)
 {
 }