-
Notifications
You must be signed in to change notification settings - Fork 0
Core.Enums
The ConfigValueType enum is used to categorize and identify the data type of configuration settings. This is particularly useful for systems that handle dynamic configuration loading (e.g., from JSON, XML, or a database) where the application needs to know how to parse or cast a raw value.
| Value | Description |
|---|---|
IsString |
The configuration value is a text string. |
IsInt |
The configuration value is an integer. |
IsFloat |
The configuration value is a floating-point number. |
IsBool |
The configuration value is a boolean (true/false). |
Use this enum in a Setting class or a settings manager to ensure that user-defined configurations are validated and converted correctly before being used in the game logic.
using Meatcorps.Engine.Core.Enums;
public class ConfigSetting
{
public string Key { get; set; }
public string RawValue { get; set; }
public ConfigValueType ValueType { get; set; }
public object GetParsedValue()
{
return ValueType switch
{
ConfigValueType.IsInt => int.Parse(RawValue),
ConfigValueType.IsFloat => float.Parse(RawValue),
ConfigValueType.IsBool => bool.Parse(RawValue),
_ => RawValue
};
}
}The PlayerInputType enum defines the hardware or method being used by the player to interact with the game.
| Value | Description |
|---|---|
KeyboardMouse |
Standard PC setup using both keyboard and mouse. |
Keyboard |
Input restricted to the keyboard only. |
GamePad |
Console-style controllers (Xbox, PlayStation, etc.). |
Arcade |
Specialized arcade cabinets or fight sticks. |
Unknown |
Fallback for unrecognized or disconnected input devices. |
This is essential for "Dynamic Input Prompting." For example, if the player moves a joystick, the game UI can switch from showing "Press [E] to Interact" to "Press (X) to Interact."
using Meatcorps.Engine.Core.Enums;
public void UpdateUIHints(PlayerInputType currentInput)
{
switch (currentInput)
{
case PlayerInputType.GamePad:
Console.WriteLine("Displaying Controller Icons...");
break;
case PlayerInputType.KeyboardMouse:
Console.WriteLine("Displaying Keyboard Keycaps...");
break;
}
}The EaseType enum contains a comprehensive list of mathematical easing functions. These are used to control the rate of change of a parameter over time, making animations look more natural (e.g., accelerating, decelerating, or bouncing).
- Linear: Constant speed.
- Quad/Cubic/Quart/Quint: Power-based acceleration/deceleration.
- Sine: Smooth, wave-like movement.
- Back: Overshoots the target and pulls back.
- Bounce: Mimics a physical bouncing effect.
- Elastic: Mimics a rubber band or spring effect.
Used extensively in UI transitions, camera shakes, or smoothing character movement. Instead of a linear "A to B" movement, easing provides a "polished" feel to the game.
using Meatcorps.Engine.Core.Enums;
public class Tween
{
public float CalculateValue(float start, float end, float t, EaseType ease)
{
// 't' is usually normalized time between 0.0 and 1.0
if (ease == EaseType.EaseInCubic)
{
return start + (end - start) * (t * t * t);
}
// Hypothetical helper call
return EasingMath.Apply(ease, start, end, t);
}
}-
RandomEnum<T>: Likely a utility to pick a random value from any of the enums above (e.g., picking a random ease for a juice effect). -
AudioEnumBinder: A system that maps specific enum values (like aSoundEffectenum) to actual audio files in the resource manager.