예제 #1
0
 /// <summary>
 /// Gets the ***version-specific*** plCreatable Type ID for a given Creatable
 /// </summary>
 /// <param name="pCre">The Creatable to get the ID of</param>
 /// <param name="v">The Plasma Version to get the ID for</param>
 /// <returns>Unmanaged Creatable Type</returns>
 public static ushort ClassIndex(plCreatable pCre, plVersion v)
 {
     string name = ClassName(pCre);
     if (Enum.IsDefined(typeof(plCreatableID), name))
         return plManagedType.ClassIndex(name, v);
     else
         throw new plFactoryException("plCreatable not in list of types!");
 }
예제 #2
0
 public static plCreatableID ClassIndex(plCreatable pCre)
 {
     string name = ClassName(pCre);
     if (Enum.IsDefined(typeof(plCreatableID), name))
         return (plCreatableID)Enum.Parse(typeof(plCreatableID), name);
     else
         throw new plFactoryException("plCreatable not in list of types!");
 }
예제 #3
0
 public void WriteCreatable(hsStream s, plCreatable pCre)
 {
     if (pCre == null)
         plManagedType.Write(s, plCreatableID.NULL);
     else {
         plManagedType.Write(s, plFactory.ClassIndex(pCre));
         pCre.Write(s, this);
     }
 }
예제 #4
0
 public static string ClassName(plCreatable pCre)
 {
     return pCre.GetType().ToString().Substring(7);
 }