Ejemplo n.º 1
0
        public static IEnumerator GetShowcase(
            Client client,
            GameSession session,
            string showcaseNamespaceName,
            string showcaseName,
            GetShowcaseEvent onGetShowcase,
            ErrorEvent onError
            )
        {
            AsyncResult <EzGetShowcaseResult> result = null;

            yield return(client.Showcase.GetShowcase(
                             r =>
            {
                result = r;
            },
                             session,
                             showcaseNamespaceName,
                             showcaseName
                             ));

            if (result.Error != null)
            {
                onError.Invoke(
                    result.Error
                    );
                yield break;
            }

            var showcase = result.Result.Item;

            onGetShowcase.Invoke(showcase);
        }
Ejemplo n.º 2
0
        public IEnumerator Run(
            Client client,
            GameSession session,
            string showcaseNamespaceName,
            string showcaseName,
            GetShowcaseEvent onGetShowcase,
            ErrorEvent onError
            )
        {
            if (_watching)
            {
                throw new InvalidOperationException("already started");
            }

            _watching = true;

            _client  = client;
            _session = session;

            _showcaseNamespaceName = showcaseNamespaceName;
            _showcaseName          = showcaseName;
            _onGetShowcase         = onGetShowcase;
            _onError = onError;

            yield return(Refresh());
        }