void Start() { OnStateChangeDelegate oscd = (State crr, State old) => { foreach (StateOverseer so in overseers) { so.OnStateChange(crr, old); } }; if (onStateChange == null) { onStateChange = oscd; } else { onStateChange += oscd; } objectNameBase = gameObject.name; Configure(); if (currentState == null) { Debug.LogWarning("After Configure() there is still no currentState"); } }
public VMClientDriver(OnStateChangeDelegate callback) { OutgoingCommands = new Queue <VMNetCommandBodyAbstract>(); ServerMessages = new Queue <VMNetMessage>(); OnStateChange += callback; GlobalLink = null; //transactions only performed by server. transaction results //are passed back to the clients as commands (for the primitive, at least) TickBuffer = new Queue <VMNetTick>(); }
public VMClientDriver(string hostName, int port, OnStateChangeDelegate callback) { Commands = new Queue<VMNetCommandBodyAbstract>(); Client = new NetworkClient(hostName, port, EncryptionMode.NoEncryption, true); Client.OnConnected += Client_OnConnected; Client.OnDisconnect += Client_OnDisconnect; OnStateChange += callback; Client.Connect(null); TickBuffer = new Queue<VMNetTick>(); }
public VMClientDriver(string hostName, int port, OnStateChangeDelegate callback) { Commands = new Queue <VMNetCommandBodyAbstract>(); Client = new NetworkClient(hostName, port, EncryptionMode.NoEncryption, true); Client.OnConnected += Client_OnConnected; Client.OnDisconnect += Client_OnDisconnect; OnStateChange += callback; Client.Connect(null); TickBuffer = new Queue <VMNetTick>(); }
public VMClientDriver(string hostName, int port, OnStateChangeDelegate callback) { Commands = new Queue <VMNetCommandBodyAbstract>(); Client = new NetworkClient(hostName, port, EncryptionMode.NoEncryption, true); Client.OnConnected += Client_OnConnected; Client.OnDisconnect += Client_OnDisconnect; OnStateChange += callback; Client.Connect(null); GlobalLink = null; //transactions only performed by server. transaction results //are passed back to the clients as commands (for the primitive, at least) TickBuffer = new Queue <VMNetTick>(); }
private VM VMHook; //should probably always backreference the VM anyways, but just used by disconnect #endregion Fields #region Constructors public VMClientDriver(string hostName, int port, OnStateChangeDelegate callback) { Commands = new Queue<VMNetCommandBodyAbstract>(); Client = new NetworkClient(hostName, port, EncryptionMode.NoEncryption, true); Client.OnConnected += Client_OnConnected; Client.OnDisconnect += Client_OnDisconnect; OnStateChange += callback; Client.Connect(null); GlobalLink = null; //transactions only performed by server. transaction results //are passed back to the clients as commands (for the primitive, at least) TickBuffer = new Queue<VMNetTick>(); }