// Use this to bake all values into the game, including // visuals (tags, writings on the bag, size&color etc.) // and game logic. // The luggage is invalid if not baked. public void BakeValues() { // Set appropriate color for tag. if (baggageData.Destination == "HOM") { // Arrival bag tagRenderer.material.color = Color.yellow; luggageType = LuggageType.ARRIVAL; } else if (baggageData.Provenance == "HOM") { // Departure Bag tagRenderer.material.color = Color.green; luggageType = LuggageType.DEPARTURE; } else { // Transfer bag tagRenderer.material.color = Color.blue; luggageType = LuggageType.TRANSFER; } // Set luggage color GetComponent <Renderer>().material.color = baggageData.Color; // Set luggage size transform.localScale = baggageData.BagSize; tagText.text = baggageData.Provenance + "\n" + baggageData.Destination; }
public async Task <NewOrderResultDto> NewOrderAsync(long userid, double startlat, double startlong, double endlat, double endlong, double distance, CarType type, double cost, OrderStatus status, PaymentType paymenttype, LuggageType luggagetype) { var order = new Order() { UserId = userid, CreationTime = DateTime.Now, StartLat = startlat, StartLong = startlong, EndLat = endlat, EndLong = endlong, Distance = distance, Type = type, Cost = cost, Status = status, PaymentType = paymenttype, LuggageType = luggagetype, }; await _context.Orders.AddAsync(order); await _context.SaveChangesAsync(); return(new NewOrderResultDto() { Success = true, Status = order.Status }); }