Starting to get an overview about the usage of ids versus types to identify
interchangable objects I realized that there is a bug still lingering in the
wild: For a train exchange the id of the train exchanged was not saved, as it
used the train(type) name instead of the unique id. Unfortunately this was
not working.
I fixed that now, however: I suspect, that (at least in version 1.3) all games
with a train exchange cannot be loaded beyond that point. At least a save
file from my latest play of 1889 supports my assumption.
And I hope that there is no case where trains are selected by train type
instead of train ids, as this could imply that a train which is somewhere
else already gets exchanged (given an unfortunate sequence of undos).
Question to Erik:
There was even a TODO comment inside the BuyTrain action:
trainsForExchangeUniqueIds[i] = trains.get(i).getName();
// TODO: Must be replaced by unique Ids
It was not the important line (that is the one which defines the
exchangedTrainUniqueId variable).
But still any reason why you have used getName() at the time of
implementation?
Stefan
|