Skip to content

Commit

Permalink
Fix: It was possible for TD to accept an empty cargo load as an optio…
Browse files Browse the repository at this point in the history
…n by mistake.
  • Loading branch information
kfsone committed Sep 12, 2014
1 parent f3ee1bf commit 1f76202
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tradecalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
from tradedb import System, Station
from collections import namedtuple

TradeLoad = namedtuple('TradeLoad', [ 'items', 'gainCr', 'costCr', 'units' ])
class TradeLoad(namedtuple('TradeLoad', [ 'items', 'gainCr', 'costCr', 'units' ])):
def __bool__(self):
return self.units > 0

emptyLoad = TradeLoad([], 0, 0, 0)

TradeHop = namedtuple('TradeHop', [ 'destSys', 'destStn', 'load', 'gainCr', 'jumps', 'ly' ])
Expand Down

0 comments on commit 1f76202

Please sign in to comment.