Package fr.formiko.views.gui2d
Class ThMove
java.lang.Object
fr.formiko.views.gui2d.ThMove
A simple Thread extends class to move ObjetSurCarteAId.
It modify only rotation & position so it won't break any game mechanic.
It modify only rotation & position so it won't break any game mechanic.
- Author:
- Hydrolien
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Comparator<ThMove>private static intprivate fr.formiko.usual.Pointprivate fr.formiko.usual.Pointprivate static fr.formiko.usual.structures.listes.Liste<ThMove>private fr.formiko.usual.Pointprivate intprivate intprivate intprivate booleanprivate intprivate ObjetSurCarteAIdprivate static fr.formiko.usual.structures.listes.Liste<ThMove>private fr.formiko.usual.Pointprivate doubleprivate static ThMoveManagerprivate longprivate fr.formiko.usual.Pointprivate doubleprivate doubleprivate double -
Constructor Summary
ConstructorsConstructorDescriptionThMove(ObjetSurCarteAId o, CCase from, CCase to) Create Thread for the ObjetSurCarteAId animation. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddToQueue(ThMove th) add an item to the queue.voidendRun()End the ObjetSurCarteAId animation by removing this from the 2 thread.private intintgetIdTh()private voidInitialize before launch start function.voidiniRun()Initialize the ObjetSurCarteAId animation.voidoneStep()Do a step of the ObjetSurCarteAId animation.(package private) static voidUpdate the queue by launching all ThMove that can be launch.static voidUpdate all ThMove that need to be change if ant move a 2a time.private voidupdateTo(fr.formiko.usual.Point to) Update the destination Point.
-
Field Details
-
o
-
from
private fr.formiko.usual.Point from -
to
private fr.formiko.usual.Point to -
curent
private fr.formiko.usual.Point curent -
curent2
private fr.formiko.usual.Point curent2 -
rotate
private fr.formiko.usual.Point rotate -
vectX
private double vectX -
vectY
private double vectY -
vectRotate
private double vectRotate -
curentThList
-
queue
-
id
private int id -
cptId
private static int cptId -
lock
private boolean lock -
time
private long time -
comparator
-
thMoveManager
-
k
private int k -
kIni
private int kIni -
numberOfTic
private int numberOfTic -
rotateAngle
private double rotateAngle
-
-
Constructor Details
-
ThMove
Create Thread for the ObjetSurCarteAId animation.- Parameters:
o- the Object to animate.from- CCase from where it move.to- CCase where it move.
-
-
Method Details
-
getIdMovingObject
private int getIdMovingObject() -
getIdTh
public int getIdTh() -
iniBeforeStart
private void iniBeforeStart()Initialize before launch start function. It Initialize Point and add to the 2 curent list. -
addToQueue
add an item to the queue. Item are sorted in queue so that they will be launch in the creation order. -
updateQueue
static void updateQueue()Update the queue by launching all ThMove that can be launch. -
updateTo
private void updateTo(fr.formiko.usual.Point to) Update the destination Point.- Parameters:
to- the new destination.
-
updateTo
Update all ThMove that need to be change if ant move a 2a time. It will update all ThMove that haven't been done & that are about ObjetSurCarteAId with given id.- Parameters:
to- new CCase were to go.id- id of the concerned ObjetSurCarteAId.
-
iniRun
public void iniRun()Initialize the ObjetSurCarteAId animation. -
oneStep
public void oneStep()Do a step of the ObjetSurCarteAId animation. Call end run if it's over. -
endRun
public void endRun()End the ObjetSurCarteAId animation by removing this from the 2 thread.
-