mirror of
https://github.com/Stone-Red-Code/StoneRed.LogicSimulator.git
synced 2026-09-06 16:05:59 +02:00
Add save and loader classes and some QoL improvements
This commit is contained in:
@@ -2,25 +2,23 @@
|
||||
|
||||
using MonoGame.Extended.Input;
|
||||
|
||||
using StoneRed.LogicSimulator.Simulation.LogicGates.Attributes;
|
||||
using StoneRed.LogicSimulator.Simulation.LogicGates.Interfaces;
|
||||
|
||||
namespace StoneRed.LogicSimulator.Simulation.LogicGates;
|
||||
|
||||
[LogicGateName("Switch")]
|
||||
[LogicGateDescription("A switch is a toggleable switch that can be turned on and off.")]
|
||||
internal class Switch : LogicGate, IInteractable, IColorable
|
||||
{
|
||||
public override int OutputCount => 1;
|
||||
public override int OutputCount { get; set; } = 1;
|
||||
|
||||
public override int InputCount => 0;
|
||||
public override int InputCount { get; set; } = 0;
|
||||
|
||||
public bool IsPressed { get; set; }
|
||||
public Color Color { get; set; } = Color.Purple;
|
||||
public string Info { get; set; } = "OFF";
|
||||
|
||||
public Switch()
|
||||
{
|
||||
Metadata.Name = "Switch";
|
||||
}
|
||||
|
||||
public void OnInteraction(MouseStateExtended mouseState, MouseStateExtended previousMouseState, KeyboardStateExtended keyboardStateExtended)
|
||||
{
|
||||
if (mouseState.IsButtonDown(MouseButton.Left) && !previousMouseState.IsButtonDown(MouseButton.Left))
|
||||
|
||||
Reference in New Issue
Block a user