forked from s425077/PotatoPlan
73 lines
1.5 KiB
C#
73 lines
1.5 KiB
C#
|
using Microsoft.Xna.Framework;
|
|||
|
using Microsoft.Xna.Framework.Input;
|
|||
|
using Microsoft.Xna.Framework.Graphics;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
class Input
|
|||
|
{
|
|||
|
private KeyboardState state = Keyboard.GetState();
|
|||
|
private GraphicsDeviceManager graphics;
|
|||
|
private Vector2 Size;
|
|||
|
private int tileSize;
|
|||
|
private int Spacing;
|
|||
|
private Controller controller = new Controller();
|
|||
|
|
|||
|
public void init(GraphicsDeviceManager Graphics, Vector2 size, int TileSize, int SPacing)
|
|||
|
{
|
|||
|
graphics = Graphics;
|
|||
|
tileSize = TileSize;
|
|||
|
Spacing = SPacing;
|
|||
|
Size = size;
|
|||
|
|
|||
|
controller.init(Graphics);
|
|||
|
}
|
|||
|
|
|||
|
public int changeSpeed(int Speed)
|
|||
|
{
|
|||
|
return controller.controllSpeed(Speed);
|
|||
|
}
|
|||
|
|
|||
|
public tractorPositionCorrector changeTractorSpeed(float tractorSpeed, Vector2 Position)
|
|||
|
{
|
|||
|
return controller.controllTractorSpeed(tractorSpeed, Position);
|
|||
|
}
|
|||
|
|
|||
|
private void changeSize()
|
|||
|
{
|
|||
|
Size = controller.updateWindow(tileSize, Spacing, Size);
|
|||
|
}
|
|||
|
|
|||
|
public void controlWindowSize()
|
|||
|
{
|
|||
|
tileSize = controller.controllTileSize(Size, tileSize);
|
|||
|
changeSize();
|
|||
|
graphics.ApplyChanges();
|
|||
|
}
|
|||
|
|
|||
|
public int getTileSize()
|
|||
|
{
|
|||
|
return tileSize;
|
|||
|
}
|
|||
|
|
|||
|
public int getSpacing()
|
|||
|
{
|
|||
|
return Spacing;
|
|||
|
}
|
|||
|
|
|||
|
public Vector2 getSize()
|
|||
|
{
|
|||
|
return Size;
|
|||
|
}
|
|||
|
|
|||
|
public int getSpacingTile()
|
|||
|
{
|
|||
|
return Spacing + tileSize;
|
|||
|
}
|
|||
|
|
|||
|
public void setTileSize(int newTileSize)
|
|||
|
{
|
|||
|
tileSize = newTileSize;
|
|||
|
}
|
|||
|
}
|