public void FuelLevelChanged(AbstractVehicle sender, FuelLevelChangedEventArgs args) { Trace("\n"); Trace("Managed code: FuelLevelChanged was called!!\n"); Trace(String.Format(" this: {0}\n", this)); Trace(String.Format(" sender.VIN: {0}\n", sender.VIN)); Trace(String.Format(" args.Level: {0}\n", args.Level)); Trace(String.Format(" args.OldLevel: {0}\n", args.OldLevel)); Trace("\n"); }
public Game(AbstractFactory factory) { this.vehicle = factory.CreateVehicle(); this.vehicle.Capacity = 10; for (int i = 0; i < 5; i++) { AbstractBuilding b = factory.CreateBuilding(); b.X = (i + 1) * 4; b.Y = (i * 3); b.Storage = 100; this.buildings.Add(b); } }
static int PrintAbstractVehicle(string context, AbstractVehicle av) { string s = ""; s += String.Format("context: {0}\n", context); s += String.Format(" av: {0}\n", av); s += String.Format(" VehicleType: {0}\n", av.VehicleType); s += String.Format(" Mileage: {0}\n", av.Mileage); s += String.Format(" VIN: {0}\n", av.VIN); s += String.Format(" TGetHasLicensePlate(): {0}\n", av.TGetHasLicensePlate()); s += String.Format(" Registered: {0}\n", av.Registered); s += String.Format(" FuelLevel: {0}\n", av.FuelLevel); s += String.Format(" TGetCallback(): {0}\n", av.TGetCallback()); s += String.Format(" TGetClientData(): {0}\n", av.TGetClientData()); s += String.Format(" TGetManufacturerID(): {0}\n", av.TGetManufacturerID()); s += "\n"; System.Diagnostics.Debug.Write(s); Console.Error.Write(s); return(0); }
static int PrintAbstractVehicle(string context, AbstractVehicle av) { string s = ""; s += String.Format("context: {0}\n", context); s += String.Format(" av: {0}\n", av); s += String.Format(" VehicleType: {0}\n", av.VehicleType); s += String.Format(" Mileage: {0}\n", av.Mileage); s += String.Format(" VIN: {0}\n", av.VIN); s += String.Format(" TGetHasLicensePlate(): {0}\n", av.TGetHasLicensePlate()); s += String.Format(" Registered: {0}\n", av.Registered); s += String.Format(" FuelLevel: {0}\n", av.FuelLevel); s += String.Format(" TGetCallback(): {0}\n", av.TGetCallback()); s += String.Format(" TGetClientData(): {0}\n", av.TGetClientData()); s += String.Format(" TGetManufacturerID(): {0}\n", av.TGetManufacturerID()); s += "\n"; System.Diagnostics.Debug.Write(s); Console.Error.Write(s); return 0; }
private static void TestVehicle(AbstractVehicle vehicle) => vehicle.Test();