Indiefreaks.Xna.Logic.Command.Command C# (CSharp) Method

Command() public method

Creates a new Command instance
public Command ( System.Condition condition, ClientCommand clientExecution, ServerCommand serverExecution, ApplyServerCommand applyServerResult, CommandType comandType, Type networkValueType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : System
condition System.Condition
clientExecution ClientCommand The method that will be executed
serverExecution ServerCommand
applyServerResult ApplyServerCommand
comandType CommandType The CommandType of this Command
networkValueType System.Type The type of the value that is returned by the Execution delegate, if the command doesn't returns a value, you can set this to null to limit network data transfer
dataTransferOptions DataTransferOptions Defines options for network packet transmission
frequency ExecutionFrequency Defines the frequency at which the current command will be processed
return System
        public Command(Condition condition, ClientCommand clientExecution, ServerCommand serverExecution,
                         ApplyServerCommand applyServerResult, CommandType comandType, Type networkValueType,
                         DataTransferOptions dataTransferOptions, ExecutionFrequency frequency)
        {
            if (networkValueType != null && !networkValueType.IsValueType && networkValueType != typeof(string) && networkValueType != typeof(byte[]))
                throw new CoreException("DataType must be a ValueType.");

            LocalId = _count++;
            Condition = condition;
            ClientExecution = clientExecution;
            ServerExecution = serverExecution;
            ApplyServerResult = applyServerResult;
            Type = comandType;
            NetworkValueType = networkValueType;
            TransferOptions = dataTransferOptions;
            Frequency = frequency;
        }