コード例 #1
0
        private async Task HandlerUpdates(IDifference diff)
        {
            switch (diff)
            {
            case TDifference difference:
                ClientSettings.ClientSession.UpdateState = (TState)difference.State;

                ReceiveUpdates?.Invoke(difference);
                break;

            case TDifferenceEmpty _:
                return;

            case TDifferenceSlice differenceSlice:
                var newState = ClientSettings.ClientSession.UpdateState = (TState)differenceSlice.IntermediateState;

                ReceiveUpdates?.Invoke(differenceSlice);

                await GetUpdatesFromState(newState).ConfigureAwait(false);

                break;

            case TDifferenceTooLong differenceTooLong:
                ReceiveUpdates?.Invoke(differenceTooLong);
                break;
            }
        }
コード例 #2
0
ファイル: ScriptInstance.cs プロジェクト: yonder/CryMono
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hash = 17;

                hash = hash * 29 + ScriptId.GetHashCode();
                hash = hash * 29 + ReceiveUpdates.GetHashCode();

                return(hash);
            }
        }