Class ThMove

java.lang.Object
fr.formiko.views.gui2d.ThMove

public class ThMove extends Object
A simple Thread extends class to move ObjetSurCarteAId.
It modify only rotation & position so it won't break any game mechanic.
Author:
Hydrolien
  • Field Details

    • o

      private ObjetSurCarteAId 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

      private static fr.formiko.usual.structures.listes.Liste<ThMove> curentThList
    • queue

      private static fr.formiko.usual.structures.listes.Liste<ThMove> queue
    • id

      private int id
    • cptId

      private static int cptId
    • lock

      private boolean lock
    • time

      private long time
    • comparator

      private static Comparator<ThMove> comparator
    • thMoveManager

      private static ThMoveManager thMoveManager
    • k

      private int k
    • kIni

      private int kIni
    • numberOfTic

      private int numberOfTic
    • rotateAngle

      private double rotateAngle
  • Constructor Details

    • ThMove

      public ThMove(ObjetSurCarteAId o, CCase from, CCase to)
      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

      private static void addToQueue(ThMove th)
      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

      public static void updateTo(CCase to, int id)
      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.