Ejemplo n.º 1
0
        public static void RegisterPotionEffectType(PotionEffectType type)
        {
            if (byId[type.id] != null || byName.ContainsKey(type.GetName().ToLower()))
            {
                throw new ArgumentException("Cannot set already-set type");
            }
            else if (!acceptingNew)
            {
                throw new Exception(
                          "No longer accepting new potion effect types (can only be done by the server implementation)");
            }

            byId[type.id] = type;
            byName.Add(type.GetName().ToLower(), type);
        }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return(type.GetName() + (ambient ? ":(" : ":") + duration + "t-x" + amplifier + (ambient ? ")" : ""));
 }