feat: Setup MVP
This commit is contained in:
parent
14fdd4558e
commit
1dd490b7ed
27 changed files with 555 additions and 52 deletions
13
Assets/Scripts/Domain/Model.cs
Normal file
13
Assets/Scripts/Domain/Model.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
namespace Domain {
|
||||
public class Model {
|
||||
public int Score { private set; get; }
|
||||
|
||||
public Model(int score) {
|
||||
Score = score;
|
||||
}
|
||||
|
||||
public void AddScore(int score) {
|
||||
Score += score;
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Scripts/Domain/Model.cs.meta
Normal file
3
Assets/Scripts/Domain/Model.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6de5729981004dd98a2b547a5acf3bb2
|
||||
timeCreated: 1712931104
|
3
Assets/Scripts/Domain/SantJordi.Domain.asmdef
Normal file
3
Assets/Scripts/Domain/SantJordi.Domain.asmdef
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"name": "SantJordi.Domain"
|
||||
}
|
7
Assets/Scripts/Domain/SantJordi.Domain.asmdef.meta
Normal file
7
Assets/Scripts/Domain/SantJordi.Domain.asmdef.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 23c7c01f8c5436c429399011615ce636
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Scripts/Domain/Win32API.cs
Normal file
29
Assets/Scripts/Domain/Win32API.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Domain {
|
||||
public static class Win32API {
|
||||
private static bool _cTrencadaWasPressed;
|
||||
private static bool _cTrencadaPressed;
|
||||
//VK_OEM_2 = 0xBF | cedilla
|
||||
//https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
|
||||
private const int Key = 0xBF;
|
||||
|
||||
public static void UpdateInput() {
|
||||
_cTrencadaWasPressed = _cTrencadaPressed;
|
||||
if (_cTrencadaPressed && GetAsyncKeyState(Key) == 0) {
|
||||
_cTrencadaPressed = false;
|
||||
return;
|
||||
}
|
||||
if (!_cTrencadaPressed && GetAsyncKeyState(Key) != 0) {
|
||||
_cTrencadaPressed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CTrencadaDown() {
|
||||
return _cTrencadaPressed && !_cTrencadaWasPressed;
|
||||
}
|
||||
|
||||
[DllImport("User32.dll")]
|
||||
private static extern short GetAsyncKeyState(int vKey);
|
||||
}
|
||||
}
|
3
Assets/Scripts/Domain/Win32API.cs.meta
Normal file
3
Assets/Scripts/Domain/Win32API.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8146fbf025e0444dae51ba3f7c693f8a
|
||||
timeCreated: 1712920866
|
Loading…
Add table
Add a link
Reference in a new issue