package com.dubiousoft.sakana;

import android.content.res.AssetManager;
import android.graphics.Point;

public class NativeSakana {
	public NativeSakana( AssetManager Manager, Point Dimensions, String Path ) {
		InitializeNativeLayer( Manager, Dimensions.x, Dimensions.y, Path );
	}
	
	public synchronized void DrawScene()
	{
		Draw();
	}
	
	public synchronized void Physics( float elapsed )
	{
		UpdatePhysics( elapsed );
	}
	
	public synchronized void ResetOpenGL()
	{
		ResetGL();
	}
	
	public synchronized void MoveCamera( Point offset )
	{
		Move( offset.x, offset.y );
	}
	
	public synchronized void ZoomCamera( int dSpan )
	{
		Zoom( dSpan );
	}

	public synchronized void FireBullet( AssetManager manager, float SliderPos, Point Target )
	{
		Fire( manager, SliderPos, Target.x, Target.y );
	}
	
	public synchronized void SelectWeapon( int Index )
	{
		SetWeapon( Index );
	}
	
	public synchronized int Score()
	{
		return GetScore();
	}
	
	public synchronized boolean SceneIsFinished()
	{
		return SceneFinished();
	}
	
    private native void InitializeNativeLayer( AssetManager Manager, int width, int height, String Path );
	private native void Draw();
	private native void UpdatePhysics( float elapsed );
	private native void ResetGL();
	private native void Move( int dX, int dY );
	private native void Zoom( int dSpan );
	private native void Fire( AssetManager manager, float SliderPos, int x, int y );
	private native void SetWeapon( int Index );
	private native int GetScore();
	private native boolean SceneFinished();
	
    static {
        System.loadLibrary("NativeSakana");
    }
}
