Initial commit

This commit is contained in:
2022-03-28 18:44:08 -04:00
commit e43d9a90e7
267 changed files with 17049 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
using System.Collections.Generic;
namespace Model.Immortal.Entity.Parts;
public class EntityHotkeyModel : IEntityPartInterface {
public string Type { get; set; } = "EntityHotkeyModel";
public string Hotkey { get; set; }
public bool HoldSpace { get; set; } = false;
public string HotkeyGroup { get; set; }
public bool IsSelectedHotkey(List<string> keys) {
return keys.Contains(Hotkey.ToUpper());
}
public bool IsSelectedHotkeyGroup(List<string> keys) {
return keys.Contains(HotkeyGroup.ToUpper());
}
public bool IsSelectedHoldSpace(List<string> keys) {
return (keys.Contains("SPACE") || keys.Contains(" ")) == HoldSpace;
}
public bool IsSelectedHotkeyGroupWithSpace(List<string> keys) {
var foundKey = false;
var foundHold = false;
foreach (var key in keys) {
if (key.ToUpper().Equals(HotkeyGroup.ToUpper())) foundKey = true;
if (key.ToUpper().Equals("SPACE") || key.ToUpper().Equals(" ")) foundHold = true;
}
if (foundKey && foundHold == HoldSpace) return true;
return false;
}
}