public CustomerEntity(string filename) { this.filename = filename; customerInfo = CustomerInfo.SplitCustomerInfo(this.filename); this.customerName = customerInfo[1]; counter = customerInfo[2]; platform = customerInfo[3]; destination = customerInfo[4]; timelimit = customerInfo[5]; points = customerInfo[6]; countTime = new TimedEvent(TimeSpanType.Seconds, Int32.Parse(counter), "", "", ""); timeToDrop = new TimedEvent(TimeSpanType.Seconds, Int32.Parse(timelimit), "", "", ""); Entity = new Entity(new DynamicShape(new Vec2F( CustomerInfo.PickupPosition(this.filename).Item1, CustomerInfo.PickupPosition(this.filename).Item2), new Vec2F(0.06f, 0.06f)), new Image(Path.Combine("Assets", "Images", "CustomerStandRight.png"))); Entity.Shape.AsDynamicShape().Direction = new Vec2F(0, 0); countTime.ResetTimer(); timeToDrop.ResetTimer(); }
/// <summary> /// Splits the customer information string in substrings of each word /// </summary> /// <param name="info"> the information string generated from GetCustomerInfo</param> /// <returns> a string[] containing the customer information</returns> public static string[] SplitCustomerInfo(string filename) { string info = CustomerInfo.GetCustomerInfo(filename); return(info.Split()); }