Skip to content

Commit 7e0e46e

Browse files
authored
Merge pull request #14 from thomasfn/staging
release 0.1.5
2 parents 121e71e + f12324d commit 7e0e46e

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

EcoCompaniesMod/CompanyManager.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,21 @@ public void ActionPerformed(GameAction action)
4848
{
4949
switch (action)
5050
{
51+
case GameActions.CompanyExpense:
52+
case GameActions.CompanyIncome:
53+
// Catch these specifically and noop, to avoid them going into the MoneyGameAction case
54+
break;
5155
case MoneyGameAction moneyGameAction:
5256
var sourceCompany = Company.GetFromBankAccount(moneyGameAction.SourceBankAccount);
53-
if (sourceCompany != null)
54-
{
55-
sourceCompany.OnGiveMoney(moneyGameAction);
56-
//break;
57-
}
57+
sourceCompany?.OnGiveMoney(moneyGameAction);
5858
var destCompany = Company.GetFromBankAccount(moneyGameAction.TargetBankAccount);
59-
if (destCompany != null)
60-
{
61-
destCompany.OnReceiveMoney(moneyGameAction);
62-
//break;
63-
}
59+
destCompany?.OnReceiveMoney(moneyGameAction);
6460
break;
6561
case PropertyTransfer propertyTransferAction:
6662
var oldOwnerCompany = Company.GetFromLegalPerson(propertyTransferAction.CurrentOwner);
67-
if (oldOwnerCompany != null) { oldOwnerCompany.OnNoLongerOwnerOfProperty(propertyTransferAction.RelatedDeeds); }
63+
oldOwnerCompany?.OnNoLongerOwnerOfProperty(propertyTransferAction.RelatedDeeds);
6864
var newOwnerCompany = Company.GetFromLegalPerson(propertyTransferAction.NewOwner);
69-
if (newOwnerCompany != null) { newOwnerCompany.OnNowOwnerOfProperty(propertyTransferAction.RelatedDeeds); }
65+
newOwnerCompany?.OnNowOwnerOfProperty(propertyTransferAction.RelatedDeeds);
7066
break;
7167
}
7268
}

0 commit comments

Comments
 (0)