/// <summary> /// Adds the wagon. /// </summary> /// <param name="o">The o.</param> /// <returns></returns> private EntryLog AddWagon(Operation o) { EntryLog entryLog = null; if (o.AddsMerchandise) { entryLog = this.AddMerchandiseWagon(o.Value); } if (o.AddsPassenger) { entryLog = this.AddPassengerWagon(o.Value); } return(entryLog); }
/// <summary> /// Transactions the specified o. /// </summary> /// <param name="o">The o.</param> /// <returns></returns> public string Transaction(Operation o) { EntryLog entryLog = null; if (o.ItsAdding) { entryLog = this.AddWagon(o); } if (o.ItsRemoving) { entryLog = this.RemoveWagon(o.Value); } this.JournalLog.Add(entryLog); return(entryLog.Message); }
/// <summary> /// Adds the specified entry log. /// </summary> /// <param name="entryLog">The entry log.</param> public void Add(EntryLog entryLog) { this.EntryLogs.Add(entryLog); }