This commit is contained in:
Robert Vokac 2024-12-20 18:11:37 +01:00
parent defe2a04ed
commit 50151cdcfb
Signed by: robertvokac
GPG Key ID: FB9CE8E20AADA55F
27 changed files with 1399 additions and 30 deletions

View File

@ -0,0 +1,89 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import com.openeggbert.jdotnet.System.uint;
/**
*
* @author robertvokac
*/
public class Color extends Struct<Color> {
public static final Color CornflowerBlue;
public static final Color White;
private long _packedValue;
static {
CornflowerBlue = new Color(4293760356l);
White = new Color(uint.MaxValue);
}
private Color(long l) {
this._packedValue = l;
}
public byte B() {return getB();}
public byte G() {return getG();}
public byte R() {return getR();}
public byte A() {return getA();}
////
public byte getB() {
return (byte) (_packedValue >> 16);
}
public void setB(byte value) {
_packedValue = (_packedValue & 0xFF00FFFF) | ((value & 0xFF) << 16);
}
// Získá nebo nastaví zelenou složku
public byte getG() {
return (byte) (_packedValue >> 8);
}
public void setG(byte value) {
_packedValue = (_packedValue & 0xFFFF00FF) | ((value & 0xFF) << 8);
}
// Získá nebo nastaví červenou složku
public byte getR() {
return (byte) _packedValue;
}
public void setR(byte value) {
_packedValue = (_packedValue & 0xFFFFFF00) | (value & 0xFF);
}
// Získá nebo nastaví alfa složku
public byte getA() {
return (byte) (_packedValue >> 24);
}
public void setA(byte value) {
_packedValue = (_packedValue & 0xFFFFFF) | ((value & 0xFF) << 24);
}
@Override
public String toString() {
return "Color{"
+ "R=" + (getR() & 0xFF)
+ ", G=" + (getG() & 0xFF)
+ ", B=" + (getB() & 0xFF)
+ ", A=" + (getA() & 0xFF)
+ '}';
}
////
@Override
public Color copy() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
@Override
public Color reset() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
}

View File

@ -9,6 +9,7 @@ import com.openeggbert.jdotnet.System.Event;
import com.openeggbert.jdotnet.System.EventHandler;
import com.openeggbert.jdotnet.System.EventHandlerImpl;
import com.openeggbert.jxna.Microsoft.Xna.Framework.Content.ContentManager;
import com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics.GraphicsDevice;
import lombok.Getter;
import lombok.Setter;
@ -17,34 +18,41 @@ import lombok.Setter;
* @author robertvokac
*/
public class Game {
private final EventHandler<ExitingEventArgs> ExitingInternal = new EventHandlerImpl<ExitingEventArgs>();
public @Event EventHandler<ExitingEventArgs> Exiting() {return ExitingInternal;}
public boolean isMouseVisible() {
return true;
private final EventHandler<ExitingEventArgs> ExitingInternal = new EventHandlerImpl<ExitingEventArgs>();
public @Event
EventHandler<ExitingEventArgs> Exiting() {
return ExitingInternal;
}
public boolean isMouseVisible() {
return true;
//todo
}
public void setMouseVisible(boolean mouseVisible) {
//todo
}
@Getter @Setter
public ContentManager Content;
@Getter @Setter
public TimeSpan TargetElapsedTime;
@Getter @Setter
public TimeSpan InactiveSleepTime;
protected void Initialize()
{
}
}
protected void LoadContent()
{
}
public void setMouseVisible(boolean mouseVisible) {
//todo
}
@Getter
@Setter
public ContentManager Content;
@Getter
@Setter
public TimeSpan TargetElapsedTime;
@Getter
@Setter
public TimeSpan InactiveSleepTime;
protected void Initialize() {
}
protected void LoadContent() {
}
protected void UnloadContent() {
}
protected void UnloadContent()
{
}
protected void OnDeactivated(Object sender, EventArgs args) {
}
@ -54,7 +62,15 @@ public class Game {
protected void Update(GameTime gameTime) {
}
protected void Draw(GameTime gameTime) {
}
public void Exit() {}
public void Exit() {
}
public GraphicsDevice GraphicsDevice() {
return null;
//todo
}
}

View File

@ -0,0 +1,25 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
/**
*
* @author robertvokac
*/
public enum Blend {
One,
Zero,
SourceColor,
InverseSourceColor,
SourceAlpha,
InverseSourceAlpha,
DestinationColor,
InverseDestinationColor,
DestinationAlpha,
InverseDestinationAlpha,
BlendFactor,
InverseBlendFactor,
SourceAlphaSaturation
}

View File

@ -0,0 +1,25 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Readonly;
/**
*
* @author robertvokac
*/
public class BlendState extends GraphicsResource{
public static @Readonly final BlendState AlphaBlend = new BlendState("BlendState.AlphaBlend", Blend.One, Blend.InverseSourceAlpha);
private BlendState(String blendStateAlphaBlend, Blend blend, Blend blend0) {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
@Override
public void Dispose() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
}

View File

@ -0,0 +1,29 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
import com.openeggbert.jdotnet.System.IDisposable;
import com.openeggbert.jxna.Microsoft.Xna.Framework.Color;
/**
*
* @author robertvokac
*/
public class GraphicsDevice implements IDisposable {
@Override
public void Dispose() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
public Viewport Viewport() {
return null;
//todo
}
public void Clear(Color color) {
}
}

View File

@ -0,0 +1,15 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
import com.openeggbert.jdotnet.System.IDisposable;
/**
*
* @author robertvokac
*/
public abstract class GraphicsResource implements IDisposable{
}

View File

@ -0,0 +1,39 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Nullable;
import com.openeggbert.jxna.Microsoft.Xna.Framework.Color;
import com.openeggbert.jxna.Microsoft.Xna.Framework.Rectangle;
/**
*
* @author robertvokac
*/
public class SpriteBatch extends GraphicsResource {
public SpriteBatch(GraphicsDevice GraphicsDevice) {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
@Override
public void Dispose() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
public void Begin(SpriteSortMode spriteSortMode, BlendState AlphaBlend) {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
public void Draw(Texture2D texture, Rectangle destinationRectangle, @Nullable Rectangle sourceRectangle, Color color) {
}
public void End() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
}

View File

@ -0,0 +1,25 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
import lombok.Getter;
/**
*
* @author robertvokac
*/
public enum SpriteEffects {
None(0),
FlipHorizontally(1),
FlipVertically(2);
@Getter
private int number;
private SpriteEffects(int numberIn) {
this.number = numberIn;
}
}

View File

@ -0,0 +1,20 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/**
*
* @author robertvokac
*/
public enum SpriteSortMode {
Deferred,
Immediate,
Texture,
BackToFront,
FrontToBack;
}

View File

@ -0,0 +1,13 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
/**
*
* @author robertvokac
*/
public abstract class Texture extends GraphicsResource {
}

View File

@ -0,0 +1,13 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
/**
*
* @author robertvokac
*/
public class Texture2D {
}

View File

@ -0,0 +1,79 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
*
* @author robertvokac
*/
@AllArgsConstructor
@NoArgsConstructor
public class Viewport extends Struct<Viewport> {
@Getter
@Setter
private int x;
@Getter
@Setter
private int y;
@Getter
@Setter
private int width;
@Getter
@Setter
private int height;
@Getter
@Setter
private float minDepth;
@Getter
@Setter
private float maxDepth;
public int X() {
return getX();
}
public int Y() {
return getY();
}
public int Width() {
return getWidth();
}
public int Height() {
return getHeight();
}
public float MinDepth() {
return getMinDepth();
}
public float MaxDepth() {
return getMaxDepth();
}
@Override
public Viewport copy() {
return new Viewport(x, y, width, height, minDepth, maxDepth);
}
@Override
public Viewport reset() {
x = 0;
y = 0;
width = 0;
height = 0;
minDepth = 0;
maxDepth = 0;
return this;
}
}

View File

@ -4,6 +4,8 @@
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework;
import com.openeggbert.jxna.Microsoft.Xna.Framework.Graphics.GraphicsDevice;
/**
*
* @author robertvokac
@ -19,5 +21,17 @@ public class GraphicsDeviceManager {
public void setFullScreen(boolean value) {
//todo
}
public void ToggleFullScreen() {
//todo
}
public boolean IsFullScreen() {
return false;
//todo
}
public GraphicsDevice GraphicsDevice() {
return null;
//todo
}
}

View File

@ -4,7 +4,7 @@
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input;
import com.openeggbert.jdotnet.System.Struct;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import lombok.Getter;
/**

View File

@ -4,7 +4,7 @@
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input;
import com.openeggbert.jdotnet.System.Struct;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import lombok.Getter;
/**

View File

@ -0,0 +1,18 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input;
/**
*
* @author robertvokac
*/
public class Keyboard{
public static KeyboardState GetState() {
return null;
//todo
}
}

View File

@ -0,0 +1,30 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
/**
*
* @author robertvokac
*/
public class KeyboardState extends Struct<KeyboardState>{
public boolean IsKeyDown(Keys key) {
return true;
//todo
}
@Override
public KeyboardState copy() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
@Override
public KeyboardState reset() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
}

View File

@ -0,0 +1,660 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input;
import lombok.Getter;
/**
*
* @author robertvokac
*/
public enum Keys {
//
// Reserved.
None(0),
//
// BACKSPACE key.
Back(8),
//
// TAB key.
Tab(9),
//
// ENTER key.
Enter(13),
//
// CAPS LOCK key.
CapsLock(20),
//
// ESC key.
Escape(27),
//
// SPACEBAR key.
Space(32),
//
// PAGE UP key.
PageUp(33),
//
// PAGE DOWN key.
PageDown(34),
//
// END key.
End(35),
//
// HOME key.
Home(36),
//
// LEFT ARROW key.
Left(37),
//
// UP ARROW key.
Up(38),
//
// RIGHT ARROW key.
Right(39),
//
// DOWN ARROW key.
Down(40),
//
// SELECT key.
Select(41),
//
// PRINT key.
Print(42),
//
// EXECUTE key.
Execute(43),
//
// PRINT SCREEN key.
PrintScreen(44),
//
// INS key.
Insert(45),
//
// DEL key.
Delete(46),
//
// HELP key.
Help(47),
//
// Used for miscellaneous characters; it can vary by keyboard.
D0(48),
//
// Used for miscellaneous characters; it can vary by keyboard.
D1(49),
//
// Used for miscellaneous characters; it can vary by keyboard.
D2(50),
//
// Used for miscellaneous characters; it can vary by keyboard.
D3(51),
//
// Used for miscellaneous characters; it can vary by keyboard.
D4(52),
//
// Used for miscellaneous characters; it can vary by keyboard.
D5(53),
//
// Used for miscellaneous characters; it can vary by keyboard.
D6(54),
//
// Used for miscellaneous characters; it can vary by keyboard.
D7(55),
//
// Used for miscellaneous characters; it can vary by keyboard.
D8(56),
//
// Used for miscellaneous characters; it can vary by keyboard.
D9(57),
//
// A key.
A(65),
//
// B key.
B(66),
//
// C key.
C(67),
//
// D key.
D(68),
//
// E key.
E(69),
//
// F key.
F(70),
//
// G key.
G(71),
//
// H key.
H(72),
//
// I key.
I(73),
//
// J key.
J(74),
//
// K key.
K(75),
//
// L key.
L(76),
//
// M key.
M(77),
//
// N key.
N(78),
//
// O key.
O(79),
//
// P key.
P(80),
//
// Q key.
Q(81),
//
// R key.
R(82),
//
// S key.
S(83),
//
// T key.
T(84),
//
// U key.
U(85),
//
// V key.
V(86),
//
// W key.
W(87),
//
// X key.
X(88),
//
// Y key.
Y(89),
//
// Z key.
Z(90),
//
// Left Windows key.
LeftWindows(91),
//
// Right Windows key.
RightWindows(92),
//
// Applications key.
Apps(93),
//
// Computer Sleep key.
Sleep(95),
//
// Numeric keypad 0 key.
NumPad0(96),
//
// Numeric keypad 1 key.
NumPad1(97),
//
// Numeric keypad 2 key.
NumPad2(98),
//
// Numeric keypad 3 key.
NumPad3(99),
//
// Numeric keypad 4 key.
NumPad4(100),
//
// Numeric keypad 5 key.
NumPad5(101),
//
// Numeric keypad 6 key.
NumPad6(102),
//
// Numeric keypad 7 key.
NumPad7(103),
//
// Numeric keypad 8 key.
NumPad8(104),
//
// Numeric keypad 9 key.
NumPad9(105),
//
// Multiply key.
Multiply(106),
//
// Add key.
Add(107),
//
// Separator key.
Separator(108),
//
// Subtract key.
Subtract(109),
//
// Decimal key.
Decimal(110),
//
// Divide key.
Divide(111),
//
// F1 key.
F1(112),
//
// F2 key.
F2(113),
//
// F3 key.
F3(114),
//
// F4 key.
F4(115),
//
// F5 key.
F5(116),
//
// F6 key.
F6(117),
//
// F7 key.
F7(118),
//
// F8 key.
F8(119),
//
// F9 key.
F9(120),
//
// F10 key.
F10(121),
//
// F11 key.
F11(122),
//
// F12 key.
F12(123),
//
// F13 key.
F13(124),
//
// F14 key.
F14(125),
//
// F15 key.
F15(126),
//
// F16 key.
F16(127),
//
// F17 key.
F17(128),
//
// F18 key.
F18(129),
//
// F19 key.
F19(130),
//
// F20 key.
F20(131),
//
// F21 key.
F21(132),
//
// F22 key.
F22(133),
//
// F23 key.
F23(134),
//
// F24 key.
F24(135),
//
// NUM LOCK key.
NumLock(144),
//
// SCROLL LOCK key.
Scroll(145),
//
// Left SHIFT key.
LeftShift(160),
//
// Right SHIFT key.
RightShift(161),
//
// Left CONTROL key.
LeftControl(162),
//
// Right CONTROL key.
RightControl(163),
//
// Left ALT key.
LeftAlt(164),
//
// Right ALT key.
RightAlt(165),
//
// Browser Back key.
BrowserBack(166),
//
// Browser Forward key.
BrowserForward(167),
//
// Browser Refresh key.
BrowserRefresh(168),
//
// Browser Stop key.
BrowserStop(169),
//
// Browser Search key.
BrowserSearch(170),
//
// Browser Favorites key.
BrowserFavorites(171),
//
// Browser Start and Home key.
BrowserHome(172),
//
// Volume Mute key.
VolumeMute(173),
//
// Volume Down key.
VolumeDown(174),
//
// Volume Up key.
VolumeUp(175),
//
// Next Track key.
MediaNextTrack(176),
//
// Previous Track key.
MediaPreviousTrack(177),
//
// Stop Media key.
MediaStop(178),
//
// Play/Pause Media key.
MediaPlayPause(179),
//
// Start Mail key.
LaunchMail(180),
//
// Select Media key.
SelectMedia(181),
//
// Start Application 1 key.
LaunchApplication1(182),
//
// Start Application 2 key.
LaunchApplication2(183),
//
// The OEM Semicolon key on a US standard keyboard.
OemSemicolon(186),
//
// For any country/region), the '+' key.
OemPlus(187),
//
// For any country/region), the '),' key.
OemComma(188),
//
// For any country/region), the '-' key.
OemMinus(189),
//
// For any country/region), the '.' key.
OemPeriod(190),
//
// The OEM question mark key on a US standard keyboard.
OemQuestion(191),
//
// The OEM tilde key on a US standard keyboard.
OemTilde(192),
//
// The OEM open bracket key on a US standard keyboard.
OemOpenBrackets(219),
//
// The OEM pipe key on a US standard keyboard.
OemPipe(220),
//
// The OEM close bracket key on a US standard keyboard.
OemCloseBrackets(221),
//
// The OEM singled/double quote key on a US standard keyboard.
OemQuotes(222),
//
// Used for miscellaneous characters; it can vary by keyboard.
Oem8(223),
//
// The OEM angle bracket or backslash key on the RT 102 key keyboard.
OemBackslash(226),
//
// IME PROCESS key.
ProcessKey(229),
//
// Attn key.
Attn(246),
//
// CrSel key.
Crsel(247),
//
// ExSel key.
Exsel(248),
//
// Erase EOF key.
EraseEof(249),
//
// Play key.
Play(250),
//
// Zoom key.
Zoom(251),
//
// PA1 key.
Pa1(253),
//
// CLEAR key.
OemClear(254),
//
// Green ChatPad key.
ChatPadGreen(202),
//
// Orange ChatPad key.
ChatPadOrange(203),
//
// PAUSE key.
Pause(19),
//
// IME Convert key.
ImeConvert(28),
//
// IME NoConvert key.
ImeNoConvert(29),
//
// Kana key on Japanese keyboards.
Kana(21),
//
// Kanji key on Japanese keyboards.
Kanji(25),
//
// OEM Auto key.
OemAuto(243),
//
// OEM Copy key.
OemCopy(242),
//
// OEM Enlarge Window key.
OemEnlW(244);
Keys(int numberIn) {
this.number = numberIn;
}
@Getter
private int number;
}

View File

@ -13,4 +13,8 @@ public class Mouse {
public static void SetCursor(MouseCursor mouseCursor) {
//todo
}
public static MouseState GetState() {
return null;
//todo
}
}

View File

@ -0,0 +1,97 @@
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
/**
*
* @author robertvokac
*/
@AllArgsConstructor
@NoArgsConstructor
public class MouseState extends Struct<MouseState> {
private int _x;
private int _y;
private int _scrollWheelValue;
private int _horizontalScrollWheelValue;
private byte _buttons;
public int X() {
return getX();
}
public int Y() {
return getY();
}
public int ScrollWheelValue() {
return getScrollWheelValue();
}
public int HorizontalScrollWheelValue() {
return getHorizontalScrollWheelValue();
}
public byte Buttons() {
return getButtons();
}
public int getX() {
return _x;
}
public int getY() {
return _y;
}
public int getScrollWheelValue() {
return _scrollWheelValue;
}
public int getHorizontalScrollWheelValue() {
return _horizontalScrollWheelValue;
}
public byte getButtons() {
return _buttons;
}
////
public static void SetCursor(MouseCursor mouseCursor) {
//todo
}
public static MouseState GetState() {
return null;
//todo
}
public ButtonState LeftButton() {
return null;//todo
}
@Override
public MouseState copy() {
return new MouseState(_x, _y, _scrollWheelValue, _horizontalScrollWheelValue, _buttons);
}
@Override
public MouseState reset() {
_x = 0;
_y = 0;
_scrollWheelValue = 0;
_horizontalScrollWheelValue = 0;
_buttons = 0;
return this;
}
}

View File

@ -0,0 +1,53 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input.Touch;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import com.openeggbert.jdotnet.System.Collections.Generic.List_;
import java.util.Iterator;
import lombok.Getter;
/**
*
* @author robertvokac
*/
public class TouchCollection extends Struct<TouchCollection> implements Iterable<TouchLocation> {
private List_<TouchLocation> touches = new List_<>();
@Getter
public int Count;
@Override
public TouchCollection copy() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
@Override
public TouchCollection reset() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
class TouchCollectionIterator implements Iterator<TouchLocation> {
private int cursor = 0;
@Override
public boolean hasNext() {
return cursor != Count;
}
@Override
public TouchLocation next() {
TouchLocation result = touches.ElementAt(cursor);
cursor++;
return result;
}
}
@Override
public Iterator<TouchLocation> iterator() {
return new TouchCollectionIterator();
}
}

View File

@ -0,0 +1,32 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input.Touch;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import com.openeggbert.jxna.Microsoft.Xna.Framework.Vector2;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/**
*
* @author robertvokac
*/
@AllArgsConstructor @NoArgsConstructor
public class TouchLocation extends Struct<TouchLocation> {
public int Id;
public Vector2 Position;
public TouchLocationState State;
@Override
public TouchLocation copy() {
return new TouchLocation(Id, Position, State);
}
@Override
public TouchLocation reset() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
}

View File

@ -0,0 +1,25 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input.Touch;
import lombok.Getter;
/**
*
* @author robertvokac
*/
public enum TouchLocationState {
Invalid(0),
Moved(1),
Pressed(2),
Released(3);
@Getter
private final int number;
private TouchLocationState(int numberIn) {
this.number = numberIn;
}
}

View File

@ -12,5 +12,9 @@ public class TouchPanel {
public static TouchPanelCapabilities GetCapabilities () {
return null;//todo
}
public static TouchCollection GetState() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
}

View File

@ -4,7 +4,7 @@
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework.Input.Touch;
import com.openeggbert.jdotnet.System.Struct;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

View File

@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
*/
@AllArgsConstructor
@NoArgsConstructor
public class Rectangle extends com.openeggbert.jdotnet.System.Struct<Rectangle> {
public class Rectangle extends com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct<Rectangle> {
private static final Rectangle emptyRectangle = new Rectangle().reset();
@ -46,6 +46,17 @@ public class Rectangle extends com.openeggbert.jdotnet.System.Struct<Rectangle>
public int Top() { return Y;}
public int Bottom() { return Y + Height;}
public boolean IsEmpty()
{
{
if (Width == 0 && Height == 0 && X == 0)
{
return Y == 0;
}
return false;
}
}
}

View File

@ -0,0 +1,33 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jxna.Microsoft.Xna.Framework;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/**
*
* @author robertvokac
*/
@AllArgsConstructor @NoArgsConstructor
public class Vector2 extends Struct<Vector2> {
public float X;
public float Y;
@Override
public Vector2 copy() {
return new Vector2(X, Y);
}
@Override
public Vector2 reset() {
this.X = 0;
this.Y = 0;
return this;
}
}