/// <summary>
 /// Initializes a new instance of the <see cref="VehicleData" /> class.
 /// </summary>
 /// <param name="baseVehicle">The base vehicle entity (required).</param>
 /// <param name="vehicle">The vehicle entity itself (required).</param>
 public VehicleData(EntitySnapshot baseVehicle = default(EntitySnapshot), EntitySnapshot vehicle = default(EntitySnapshot))
 {
     // to ensure "baseVehicle" is required (not null)
     if (baseVehicle == null)
     {
         throw new InvalidDataException("baseVehicle is a required property for VehicleData and cannot be null");
     }
     else
     {
         this.BaseVehicle = baseVehicle;
     }
     // to ensure "vehicle" is required (not null)
     if (vehicle == null)
     {
         throw new InvalidDataException("vehicle is a required property for VehicleData and cannot be null");
     }
     else
     {
         this.Vehicle = vehicle;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DamageableData" /> class.
 /// </summary>
 /// <param name="lastAttacker">The entity which last attacked this entity.</param>
 /// <param name="lastDamage">The amount of damage inflicted by the last attacker.</param>
 public DamageableData(EntitySnapshot lastAttacker = default(EntitySnapshot), double?lastDamage = default(double?))
 {
     this.LastAttacker = lastAttacker;
     this.LastDamage   = lastDamage;
 }