Exemple #1
0
 public static void WriteSpecialAction(this NetOutgoingMessage msg, ISpecialAction action)
 {
     if (action is HealAction)
     {
         msg.Write(typeof(HealAction).GUID.GetHashCode());
         action.WriteObject(msg);
     }
     else if (action is ActiveWeapon)
     {
         msg.Write(typeof(ActiveWeapon).GUID.GetHashCode());
         action.WriteObject(msg);
     }
     else if (action is WeaponUpgrade)
     {
         msg.Write(typeof(WeaponUpgrade).GUID.GetHashCode());
         action.WriteObject(msg);
     }
     else if (action is AsteroidDamage)
     {
         msg.Write(typeof(AsteroidDamage).GUID.GetHashCode());
         action.WriteObject(msg);
     }
     else if (action is AsteroidGrowth)
     {
         msg.Write(typeof(AsteroidGrowth).GUID.GetHashCode());
         action.WriteObject(msg);
     }
     else if (action is AsteroidSlow)
     {
         msg.Write(typeof(AsteroidSlow).GUID.GetHashCode());
         action.WriteObject(msg);
     }
     else if (action is AsteroidThrow)
     {
         msg.Write(typeof(AsteroidThrow).GUID.GetHashCode());
         action.WriteObject(msg);
     }
     else if (action is StaticField)
     {
         msg.Write(typeof(StaticField).GUID.GetHashCode());
         action.WriteObject(msg);
     }
     else
     {
         msg.Write(0);
         Logger.Error("Sending unsupported action (" + action.Name + ")!");
     }
 }