예제 #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;
		}
예제 #2
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);
        }
예제 #3
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);
        }