Merge branch '113-fix-unitlabel-wenn-bei-aktivem-spy-angegriffen-wird' into 'development'
Resolve "Fix unitlabel wenn bei aktivem Spy angegriffen wird" Closes #113 See merge request marcel.schwarz/software-projekt-2!140
This commit is contained in:
commit
17332f3f54
@ -51,7 +51,11 @@ class Base: GKEntity{
|
|||||||
self.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(self.unitCount)"
|
self.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(self.unitCount)"
|
||||||
|
|
||||||
if base.component(ofType: TeamComponent.self)?.unitcountLabel.text != "" {
|
if base.component(ofType: TeamComponent.self)?.unitcountLabel.text != "" {
|
||||||
base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)"
|
if base.ownershipPlayer != self.ownershipPlayer {
|
||||||
|
base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(abs(base.unitCount - units * 2))"
|
||||||
|
} else {
|
||||||
|
base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID,
|
DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID,
|
||||||
toBase: base.baseID,
|
toBase: base.baseID,
|
||||||
|
Loading…
Reference in New Issue
Block a user