def clear(markerName): scene = sceneControl.get('battlefield') # NOTE(kgeffen) Not using objectControl because have to get multiple markers for object in scene.objects: if object.name == markerName: object.endObject()
def get(unit): scene = sceneControl.get('battlefield') # Get the object that is a 'unit' and has matching position for obj in scene.objects: if obj.name == 'unit': objPosition = obj.worldPosition if check.eq2D(objPosition, unit['position']): return obj
def createGameObject(unit): battlefield = sceneControl.get('battlefield') # Add game object obj = battlefield.addObject('unit', 'ground') # Adjust objects position to match data obj.worldPosition = getPosition.onGround(unit['position']) return obj
def add(space, markerName): # If space is in bounds if not check.outOfBounds(space): position = getPosition.onGround(space) # Get battlefield scene battlefield = sceneControl.get('battlefield') # NOTE(kgeffen) Ground is arbitrarily the object adding the marker obj = battlefield.addObject(markerName, 'ground') obj.worldPosition = position
def attempt(): cursor = objectControl.getFromScene('cursor', 'battlefield') cursorPosition = cursor.worldPosition describedUnit = unitControl.get.inSpace(cursorPosition) scene = sceneControl.get('basicInfo') if describedUnit is not None: do(describedUnit) for obj in scene.objects: obj.setVisible(True) else: for obj in scene.objects: obj.setVisible(False)