public MoveConfirmInfo(MoveContractMsg msg, int targetCompany) { this.msg = msg; this.targetCompany = targetCompany; }
private void MoveConfirmed(int traderPort, MoveContractMsg msg) { int distance = portDistances[msg.departureID + "," + msg.destID]; int time = distance / Globals.FREIGHTER_SPEED; DateTime plannedArrivalTime = DateTime.Now.AddSeconds(time); departures.Add(new MovingMsg(msg.departureID, msg.destID, msg.transactionID, DateTime.Now)); shipsInProgress.Add(new ShipInProgress(msg.departureID, msg.destID, msg.transactionID, plannedArrivalTime)); }
private void MoveAccepted(int companyID, MoveContractMsg msg) { /*if contract hasn't yet been taken, send confirmation and remove from list of untaken contracts */ int unconfirmedIndex = unconfirmedContracts.FindIndex( element => element.transactionID == msg.transactionID); if (unconfirmedIndex != -1) { moveConfirms.Add(new MoveConfirmInfo(msg, companyID)); unconfirmedContracts.RemoveAt(unconfirmedIndex); } }
private void MoveAdvertised(int traderPort, MoveContractMsg msg) { moveWishes[traderPort].Add(new MoveContractMsg(msg.departureID, msg.destID, msg.transactionID)); }