/** When a bullet give the button a friend hit, all doors with then name [doorName] are toggled. */ class DoorButton : AbstractRole { @Attribute var doorName = "door" override fun tick() { } fun hit() { for (actor in Play.instance.rocksStage.actors) { if (actor.role is Door) { val door = actor.role as Door if (door.doorName == doorName ) { door.toggle() } } } } }