17.01.2021
+ WPF-Support + Game Controller System + GameKeybind System + SM_WPF_TEST
This commit is contained in:
parent
af90d617d3
commit
6f23a80f7f
60 changed files with 1536 additions and 143 deletions
32
SMOptionals/SM.Game/Controls/GameKeybind.cs
Normal file
32
SMOptionals/SM.Game/Controls/GameKeybind.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using OpenTK.Input;
|
||||
|
||||
namespace SM.Game.Controls
|
||||
{
|
||||
public class GameKeybind
|
||||
{
|
||||
public Func<GameKeybindContext, object> Keyboard;
|
||||
public Func<GameKeybindContext, object> Controller;
|
||||
public Func<GameKeybindContext, object> AI;
|
||||
|
||||
public Func<GameKeybindContext, object> this[GameKeybindActorType type]
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GameKeybindActorType.AI:
|
||||
return AI;
|
||||
case GameKeybindActorType.Keyboard:
|
||||
return Keyboard;
|
||||
break;
|
||||
case GameKeybindActorType.Controller:
|
||||
return Controller;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(type), type, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue