You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace FiniteStateMachine
|
|
|
|
|
{
|
|
|
|
|
internal class StateTransition
|
|
|
|
|
{
|
|
|
|
|
private readonly ProcessState CurrentState;
|
|
|
|
|
private readonly Command Command;
|
|
|
|
|
|
|
|
|
|
public StateTransition(ProcessState currentState, Command command)
|
|
|
|
|
{
|
|
|
|
|
CurrentState = currentState;
|
|
|
|
|
Command = command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return 17 + 31 * CurrentState.GetHashCode() + 31 * Command.GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object? obj)
|
|
|
|
|
{
|
|
|
|
|
StateTransition other = obj as StateTransition;
|
|
|
|
|
return other != null && this.CurrentState == other.CurrentState;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|