- Yousof Osanlou
- Mahbod Ghadiri Sani
- Duniyal Rasouli
- Danial Azimi
- Arman Rostami
Use this document to understand!
This part is not written yet.
This part is not written yet.
This part is not written yet.
This part is not written yet.
This part is not written yet.
This part is not written yet.
This part is not written yet.
sets a value in middlewareValues
hashmap.
usage: if you want communicate between the middlewares you can use this method and it's complement getMiddlewareValue().
gets a value from middlewareValues
and returns it.
this is very important method. it gets a middleware and a middlewareLocation and adds the middleware in the main loop. whenever you want to add a middleware you should use this or addMiddlewareInSeries().
this methods adds a middleware to loop but it doesn't need any MiddlewareLocation.
this method remebers the last middleware that added to loop and adds the middleware after that.
so it is useful if you have some middleware that the orders of them is important just for themself and not the location in main loop.
you can add the first element with addMiddleware
and use this method for rest of the them.
important: it is important that you use the addMiddleware
for the first one to update the cursor and prevent unhandled errors.
use this if you want access to a middleware with id name.
this method is the main loop. you should not touch this one if you don't know what are you doing!! this method will call every 30ms to run the middlewares.
this method is used by the main loop.
important: you never should use this method directly for removing a middleware. instead you should use the remove
method of the Middleware
.
this method pauses the loop.
this method returns true if loop is paused and false viceversa.
returns an ArrayList
that holds the middlewars with this groupname.
this methods adds a middleware to a group. you shouldn't use this mehtod directly use Middleware.join
method instead.
this methods find the middleware by id name and calls the below method.
removes a middleware from group. you shouldn't use this method directly use Middleware.leave
instead.
you can use setValue and getValue in middleware or use setMiddlewareValue and getMiddlewareValue from MiddlewareManager to set and retrive. it is not necessary to set values only in the middleware you can use this from anywhere in the project
- gameName // its aa!
- username // current username from login page
- levelAuthor
- levelNumber
- levelName
- levelBigBallRotationSpeed
- levelNumberOfAllBalls // this key is equal to numOfAllBalls
- levelNumberOfSpinningBalls
- levelNumberOfBallsToConnect //this is the number of balls that the user must shoot to finish the level.
- levelSmallBallsColor
- levelBigBallColor
- levelSmallBallRadius
- levelBigBallRadius
- levelLineLength
- levelSpinningDirection
- levelShootBallSpeed
- levelBigBallPosition // use comma seperated statements for matrices. x,y => 200,200
- levelShootingBallPosition
- levelStartTime
- gamePanelBackground //the value is set in GamePanel.java constructor
- levelEndTime
constructor of the Middleware gets and id. important: this should be unique! please becareful!
returns groups name that this middleware joined.
this method will join the method to a group.
this method finally calls MiddlewareManager.joinGroup
.
this middleware will leave the group.
this method finally calls MiddlewareManager.leaveGroup
.
returns middleware id.
use this method for communicating between middlewars.
this method finally calls MiddlewareManager.setMiddleValue
.
use this method for communicating between middlewars.
this method finally calls MiddlewareManager.getMiddlewareValue
.
this method will call just once by the middlwareManager. use this method for statements that you want just execute once.
this method will call in every loop iteration except the first iteration of the middleware. use this method for statements that you want to execute every time the loop iterates.
if middleware init method doesn't executed yet this method returns true.
this method is used by the middlewareManager and you should not use it.
whenever you call this method the middleware be removed from the loop and will not execute in the next iteration.
this method is used by the middlewareManager and you should not use it.
this method is used by the middlewareManager and you should not use it.
this method is used by the middlewareManager and you should not use it.
this method returns the duration that middleware is in the loop in ms.
this method returns the numbers of iteration of the loop from entering this middleware to loop.