File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -48,25 +48,21 @@ public void ActionPerformed(GameAction action)
48
48
{
49
49
switch ( action )
50
50
{
51
+ case GameActions . CompanyExpense :
52
+ case GameActions . CompanyIncome :
53
+ // Catch these specifically and noop, to avoid them going into the MoneyGameAction case
54
+ break ;
51
55
case MoneyGameAction moneyGameAction :
52
56
var sourceCompany = Company . GetFromBankAccount ( moneyGameAction . SourceBankAccount ) ;
53
- if ( sourceCompany != null )
54
- {
55
- sourceCompany . OnGiveMoney ( moneyGameAction ) ;
56
- //break;
57
- }
57
+ sourceCompany ? . OnGiveMoney ( moneyGameAction ) ;
58
58
var destCompany = Company . GetFromBankAccount ( moneyGameAction . TargetBankAccount ) ;
59
- if ( destCompany != null )
60
- {
61
- destCompany . OnReceiveMoney ( moneyGameAction ) ;
62
- //break;
63
- }
59
+ destCompany ? . OnReceiveMoney ( moneyGameAction ) ;
64
60
break ;
65
61
case PropertyTransfer propertyTransferAction :
66
62
var oldOwnerCompany = Company . GetFromLegalPerson ( propertyTransferAction . CurrentOwner ) ;
67
- if ( oldOwnerCompany != null ) { oldOwnerCompany . OnNoLongerOwnerOfProperty ( propertyTransferAction . RelatedDeeds ) ; }
63
+ oldOwnerCompany ? . OnNoLongerOwnerOfProperty ( propertyTransferAction . RelatedDeeds ) ;
68
64
var newOwnerCompany = Company . GetFromLegalPerson ( propertyTransferAction . NewOwner ) ;
69
- if ( newOwnerCompany != null ) { newOwnerCompany . OnNowOwnerOfProperty ( propertyTransferAction . RelatedDeeds ) ; }
65
+ newOwnerCompany ? . OnNowOwnerOfProperty ( propertyTransferAction . RelatedDeeds ) ;
70
66
break ;
71
67
}
72
68
}
You can’t perform that action at this time.
0 commit comments