package org.cocos2dx.lib;

import java.util.ArrayList;

public class GameControllerAdapter
{
  private static ArrayList<Runnable> sRunnableFrameStartList = null;
  
  public static void addRunnableToFrameStartList(Runnable paramRunnable)
  {
    if (sRunnableFrameStartList == null) {
      sRunnableFrameStartList = new ArrayList();
    }
    sRunnableFrameStartList.add(paramRunnable);
  }
  
  private static native void nativeControllerAxisEvent(String paramString, int paramInt1, int paramInt2, float paramFloat, boolean paramBoolean);
  
  private static native void nativeControllerButtonEvent(String paramString, int paramInt1, int paramInt2, boolean paramBoolean1, float paramFloat, boolean paramBoolean2);
  
  private static native void nativeControllerConnected(String paramString, int paramInt);
  
  private static native void nativeControllerDisconnected(String paramString, int paramInt);
  
  public static void onAxisEvent(String paramString, final int paramInt1, final int paramInt2, final float paramFloat, final boolean paramBoolean)
  {
    Cocos2dxHelper.runOnGLThread(new Runnable()
    {
      public void run()
      {
        GameControllerAdapter.nativeControllerAxisEvent(GameControllerAdapter.this, paramInt1, paramInt2, paramFloat, paramBoolean);
      }
    });
  }
  
  public static void onButtonEvent(String paramString, final int paramInt1, final int paramInt2, final boolean paramBoolean1, final float paramFloat, final boolean paramBoolean2)
  {
    Cocos2dxHelper.runOnGLThread(new Runnable()
    {
      public void run()
      {
        GameControllerAdapter.nativeControllerButtonEvent(GameControllerAdapter.this, paramInt1, paramInt2, paramBoolean1, paramFloat, paramBoolean2);
      }
    });
  }
  
  public static void onConnected(String paramString, final int paramInt)
  {
    Cocos2dxHelper.runOnGLThread(new Runnable()
    {
      public void run()
      {
        GameControllerAdapter.nativeControllerConnected(GameControllerAdapter.this, paramInt);
      }
    });
  }
  
  public static void onDisconnected(String paramString, final int paramInt)
  {
    Cocos2dxHelper.runOnGLThread(new Runnable()
    {
      public void run()
      {
        GameControllerAdapter.nativeControllerDisconnected(GameControllerAdapter.this, paramInt);
      }
    });
  }
  
  public static void onDrawFrameStart()
  {
    int j;
    int i;
    if (sRunnableFrameStartList != null)
    {
      j = sRunnableFrameStartList.size();
      i = 0;
    }
    for (;;)
    {
      if (i >= j) {
        return;
      }
      ((Runnable)sRunnableFrameStartList.get(i)).run();
      i += 1;
    }
  }
  
  public static void removeRunnableFromFrameStartList(Runnable paramRunnable)
  {
    if (sRunnableFrameStartList != null) {
      sRunnableFrameStartList.remove(paramRunnable);
    }
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/org/cocos2dx/lib/GameControllerAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */