Exemplo n.º 1
0
        protected override Drawable MakeDrawable(string objName)
        {
            Drawable drawable;
            var      rulesSection   = Rules.GetOrCreateSection(objName);
            string   artSectionName = rulesSection.ReadString("Image", objName);
            var      artSection     = Art.GetOrCreateSection(artSectionName);

            switch (Type)
            {
            case CollectionType.Aircraft:
            case CollectionType.Vehicle:
                drawable = new UnitDrawable(rulesSection, artSection);
                break;

            case CollectionType.Building:
                drawable = new BuildingDrawable(rulesSection, artSection);
                break;

            case CollectionType.Infantry:
            case CollectionType.Overlay:
            case CollectionType.Smudge:
            case CollectionType.Terrain:
                drawable = new ShpDrawable(rulesSection, artSection);
                break;

            case CollectionType.Animation:
                drawable = new AnimDrawable(rulesSection, artSection);
                break;

            default:
                throw new InvalidEnumArgumentException();
            }
            return(drawable);
        }
Exemplo n.º 2
0
		protected override Drawable MakeDrawable(string objName) {
			Drawable drawable;
			var rulesSection = Rules.GetOrCreateSection(objName);
			string artSectionName = rulesSection.ReadString("Image", objName);
			var artSection = Art.GetOrCreateSection(artSectionName);

			switch (Type) {
				case CollectionType.Aircraft:
				case CollectionType.Vehicle:
					drawable = new UnitDrawable(rulesSection, artSection);
					break;
				case CollectionType.Building:
					drawable = new BuildingDrawable(rulesSection, artSection);
					break;
				case CollectionType.Infantry:
				case CollectionType.Overlay:
				case CollectionType.Smudge:
				case CollectionType.Terrain:
					drawable = new ShpDrawable(rulesSection, artSection);
					break;
				case CollectionType.Animation:
					drawable = new AnimDrawable(rulesSection, artSection);
					break;
				default:
					throw new InvalidEnumArgumentException();
			}
			return drawable;
		}
Exemplo n.º 3
0
        private Drawable InitUnitDrawable(IniFile.IniSection rulesSection, IniFile.IniSection artSection)
        {
            var drawable = new UnitDrawable(rulesSection, artSection);

            InitDrawableDefaults(drawable, artSection);

            drawable.LoadFromRules();
            return(drawable);
        }
Exemplo n.º 4
0
 private void LoadUnitDrawable(UnitDrawable drawable)
 {
     InitDrawableDefaults(drawable);
     drawable.LoadFromRules();
 }
Exemplo n.º 5
0
		private void LoadUnitDrawable(UnitDrawable drawable) {
			InitDrawableDefaults(drawable);
			drawable.LoadFromRules();
		}