Пример #1
0
		public SpritePool(String path, String layer, String origin, bool additive, SpriteGroup spriteGroup) {
			this.path = path;
			this.layer = layer;
			this.origin = origin;
			this.additive = additive;
			this.spriteGroup = spriteGroup;
		}
Пример #2
0
 public SpritePool(String path, String layer, String origin, bool additive, SpriteGroup spriteGroup)
 {
     this.path        = path;
     this.layer       = layer;
     this.origin      = origin;
     this.additive    = additive;
     this.spriteGroup = spriteGroup;
 }
Пример #3
0
		private SpritePool GetPool(String path, String layer, String origin, bool additive, SpriteGroup spriteGroup, int poolGroup) {
			String key = GetKey(path, layer, origin, additive, spriteGroup, poolGroup);

			SpritePool pool;
			if (!pools.TryGetValue(key, out pool)) {
				pool = new SpritePool(path, layer, origin, additive, spriteGroup);
				pools.Add(key, pool);
			}

			return pool;
		}
Пример #4
0
		private int GetSpriteGroupId(SpriteGroup spriteGroup) {
			if (spriteGroup == null)
				return -1;

			var index = spriteGroups.IndexOf(spriteGroup);
			if (index < 0) {
				spriteGroups.Add(spriteGroup);
				return spriteGroups.Count - 1;
			}

			return index;
		}
Пример #5
0
        private int GetSpriteGroupId(SpriteGroup spriteGroup)
        {
            if (spriteGroup == null)
            {
                return(-1);
            }

            var index = spriteGroups.IndexOf(spriteGroup);

            if (index < 0)
            {
                spriteGroups.Add(spriteGroup);
                return(spriteGroups.Count - 1);
            }

            return(index);
        }
Пример #6
0
		public SpriteGenerator Get(double startTime, double endTime, String path, String layer, String origin, bool additive, SpriteGroup spriteGroup, int poolGroup) {
			return GetPool(path, layer, origin, additive, spriteGroup, poolGroup).Get(startTime, endTime);
		}
Пример #7
0
		private String GetKey(String path, String layer, String origin, bool additive, SpriteGroup spriteGroup, int poolGroup) {
			return path + "#" + layer + "#" + origin + "#" + (additive ? "1" : "0") + "#" + GetSpriteGroupId(spriteGroup) + "#" + poolGroup;
		}
Пример #8
0
 public SpriteGenerator Get(double startTime, double endTime, String path, String layer, String origin, bool additive, SpriteGroup spriteGroup, int poolGroup)
 {
     return(GetPool(path, layer, origin, additive, spriteGroup, poolGroup).Get(startTime, endTime));
 }
Пример #9
0
 private String GetKey(String path, String layer, String origin, bool additive, SpriteGroup spriteGroup, int poolGroup)
 {
     return(path + "#" + layer + "#" + origin + "#" + (additive ? "1" : "0") + "#" + GetSpriteGroupId(spriteGroup) + "#" + poolGroup);
 }
Пример #10
0
        private SpritePool GetPool(String path, String layer, String origin, bool additive, SpriteGroup spriteGroup, int poolGroup)
        {
            String key = GetKey(path, layer, origin, additive, spriteGroup, poolGroup);

            SpritePool pool;

            if (!pools.TryGetValue(key, out pool))
            {
                pool = new SpritePool(path, layer, origin, additive, spriteGroup);
                pools.Add(key, pool);
            }

            return(pool);
        }