예제 #1
0
 public Command(ulong handNumber, int commandCode, CommandCodeEnum commandCodeEnum)
 {
     this.HandNumber      = handNumber;
     this.CommandCode     = commandCode;
     this.CommandObject   = null;
     this.CommandCodeEnum = commandCodeEnum;
 }
예제 #2
0
 public override string ToString()
 {
     return($"[{CommandCodeEnum.ToString().ToUpper()}]: {CommandObject} [{HandNumber}]");
 }
예제 #3
0
        public static IEnumerable <T> FilterCommands <T>(this IEnumerable <Command> commands, CommandCodeEnum code)
        {
            var filteredCommands = commands
                                   .Where(x => x.CommandCodeEnum == code)
                                   .Select(x => x.CommandObject)
                                   .OfType <T>()
                                   .ToArray();

            return(filteredCommands);
        }