Merge branch '84-nachkomma-stellen-entfernen' into 'development'
Resolve "Nachkomma-Stellen entfernen" Closes #84 See merge request marcel.schwarz/software-projekt-2!110
This commit is contained in:
commit
e10d57968c
@ -16,7 +16,7 @@ class GameScene: SKScene{
|
||||
|
||||
var isMoveTouch = false
|
||||
var currentDraggedBase : Base?
|
||||
static var sendUnits: CGFloat = 0
|
||||
static var sendUnits: Int = 0
|
||||
var collisionBase: Base?
|
||||
|
||||
override func sceneDidLoad() {
|
||||
@ -113,7 +113,7 @@ class GameScene: SKScene{
|
||||
touchLocation: touchLocation,
|
||||
collisionBase: collisionBase)
|
||||
)
|
||||
GameScene.sendUnits = CGFloat(currentDraggedBase!.unitCount / 2)
|
||||
GameScene.sendUnits = Int(currentDraggedBase!.unitCount / 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -123,7 +123,7 @@ class GameScene: SKScene{
|
||||
for e in entityManager.entities{
|
||||
if let modal = e as? Modal {
|
||||
if modal.type == ModalType.BaseAttack || modal.type == ModalType.BaseMoveOwnUnits {
|
||||
GameScene.sendUnits = ((e.component(ofType: SliderComponent.self)?.sliderNode.getValue ?? 0) * CGFloat((e as! Modal).unitCount)).rounded(.up)
|
||||
GameScene.sendUnits = Int(((e.component(ofType: SliderComponent.self)?.sliderNode.getValue ?? 0) * CGFloat((e as! Modal).unitCount)).rounded(.up))
|
||||
|
||||
//TODO: refactor this quick and dirty fix
|
||||
if GameScene.sendUnits == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user