mirror of
				https://github.com/klmp200/sarl-fireworks.git
				synced 2025-10-31 17:13:11 +00:00 
			
		
		
		
	reformatting all classes
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| @@ -64,7 +64,6 @@ class Positions { | ||||
| 	var rockets = new HashMap<UUID, RocketsPos>() | ||||
| 	var fire = new HashMap<UUID, FirePos>() | ||||
|  | ||||
| 	 | ||||
| 	public def getRockets() : Map<UUID, RocketsPos> { | ||||
| 		return rockets.unmodifiableView | ||||
| 	} | ||||
| @@ -113,4 +112,3 @@ class Positions { | ||||
| 	} | ||||
|  | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -59,13 +59,16 @@ agent Fire { | ||||
| 		xf = Math.random() * 10.0 - Math.random() * 5 | ||||
| 		yf = Math.random() * 10.0 + 1.0 | ||||
|  | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	on FireReady { | ||||
| 		move = atFixedDelay(30)[try{  | ||||
| 			wake(new UpdateFirePosition);} | ||||
| 			catch(e: Exception) {e.printStackTrace}] | ||||
| 		move = atFixedDelay(30) [ | ||||
| 			try { | ||||
| 				wake(new UpdateFirePosition); | ||||
| 			} catch (e : Exception) { | ||||
| 				e.printStackTrace | ||||
| 			} | ||||
| 		] | ||||
| 	} | ||||
|  | ||||
| 	on UpdateFirePosition [isFromMe(occurrence) && !frozen && !destroyed] { | ||||
| @@ -76,16 +79,20 @@ agent Fire { | ||||
|  | ||||
| 		if (grid !== null) { | ||||
| 			var list = new ArrayList<Vector<Double>> | ||||
| 			x.forEach[pos | { | ||||
| 			x.forEach [pos | | ||||
| 				{ | ||||
| 					var nvect = new Vector(2) | ||||
| 					nvect.add(pos) | ||||
| 					list.add(nvect) | ||||
| 			}] | ||||
| 			y.forEach[pos, i | { | ||||
| 				} | ||||
| 			] | ||||
| 			y.forEach [pos, i | | ||||
| 				{ | ||||
| 					var nvect = list.get(i) | ||||
| 					nvect.add(pos) | ||||
| 					list.set(i, nvect) | ||||
| 			}] | ||||
| 				} | ||||
| 			] | ||||
| 			grid.setFirePosition(id, parentID, list) | ||||
| 		} | ||||
|  | ||||
|   | ||||
| @@ -23,6 +23,7 @@ import java.util.Vector | ||||
| agent Rocket { | ||||
|  | ||||
| 	uses Lifecycle, Logging, Schedules, Behaviors, DefaultContextInteractions, InnerContextAccess | ||||
|  | ||||
| 	var x : Double | ||||
| 	var y : Double | ||||
| 	var gravity : Double | ||||
| @@ -76,9 +77,13 @@ agent Rocket { | ||||
| 		lifetime = rnd.nextInt(5) * 300 + 300 | ||||
| 		id = UUID.randomUUID | ||||
|  | ||||
| 		move = atFixedDelay(30)[try{  | ||||
| 			wake(new UpdateRocketPosition);} | ||||
| 			catch(e: Exception) {e.printStackTrace}] | ||||
| 		move = atFixedDelay(30) [ | ||||
| 			try { | ||||
| 				wake(new UpdateRocketPosition); | ||||
| 			} catch (e : Exception) { | ||||
| 				e.printStackTrace | ||||
| 			} | ||||
| 		] | ||||
| 	} | ||||
|  | ||||
| 	on UpdateRocketPosition [isFromMe(occurrence) && !frozen && !exploded] { | ||||
|   | ||||
| @@ -36,7 +36,6 @@ event SetupSettings { | ||||
| 	} | ||||
| } | ||||
|  | ||||
|  | ||||
| event Freeze { | ||||
| 	var value : boolean | ||||
|  | ||||
| @@ -44,6 +43,3 @@ event Freeze { | ||||
| 		this.value = value | ||||
| 	} | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -23,29 +23,26 @@ import javafx.util.Duration | ||||
|  | ||||
| class FXMLViewerController implements EventListener { | ||||
|  | ||||
| 	private var ispace : OpenEventSpace; | ||||
| 	private val id : UUID = UUID.randomUUID(); | ||||
|  | ||||
| 	private var ispace : OpenEventSpace; | ||||
| 	private var launched : boolean = false; | ||||
| 	private var areaCreated : boolean = false; | ||||
|  | ||||
| 	@FXML | ||||
| 	private var draw_zone : Canvas; | ||||
|  | ||||
| 	@FXML | ||||
| 	private var gravity_display : Label; | ||||
| 	@FXML | ||||
| 	private var rocket_quantity_display : Label; | ||||
| 	@FXML | ||||
| 	private var fire_quantity_display : Label; | ||||
|  | ||||
| 	@FXML | ||||
| 	private var gravity_input : ScrollBar; | ||||
| 	@FXML | ||||
| 	private var rocket_quantity_input : ScrollBar; | ||||
| 	@FXML | ||||
| 	private var fire_quantity_input : ScrollBar; | ||||
|  | ||||
| 	@FXML | ||||
| 	private var setup_button : Button; | ||||
| 	@FXML | ||||
|   | ||||
		Reference in New Issue
	
	Block a user