Exemplo n.º 1
0
 public void PlaySound(string name, int vol)
 {
     if (paused)
     {
         return;
     }
     if (sounds.ContainsKey(name))
     {
         AudioEffect ass = ((AudioEffect)sounds.Get(name));
         ass.AudioEffectVolume(vol);
         ass.PlayAudioEffect();
     }
     else
     {
         if (clipCount > 50)
         {
             int         idx  = sounds.Size() - 1;
             string      k    = (string)sounds.GetKey(idx);
             AudioEffect clip = (AudioEffect)sounds.Remove(k);
             clip.StopAudioEffect();
             clip = null;
             clipCount--;
         }
         asound = new AudioEffect(name);
         asound.AudioEffectVolume(vol);
         asound.PlayAudioEffect();
         sounds.Put(name, asound);
         clipCount++;
     }
 }
Exemplo n.º 2
0
        public static ArrayType Instance(CilType type)
        {
            if (type == null)
            {
                return(ReferenceType);
            }
            if (ArrayMap.ContainsKey(type))
            {
                return(ArrayMap[type]);
            }
            var result = new ArrayType(type);

            ArrayMap.Add(type, result);
            return(result);
        }