Ejemplo n.º 1
0
        public void Execute(TexImage image, IRequest request)
        {
            if (image.GetType() != typeof(TexAtlas))
            {
                throw new TextureToolsException("The given texture must be an instance of TexAtlas.");
            }

            TexAtlas atlas = (TexAtlas)image;

            switch (request.Type)
            {
            case RequestType.AtlasCreation:
                Create(atlas, (AtlasCreationRequest)request, 0);
                break;

            case RequestType.AtlasExtraction:
                Extract(atlas, (AtlasExtractionRequest)request);
                break;

            case RequestType.AtlasUpdate:
                Update(atlas, (AtlasUpdateRequest)request);
                break;

            default:
                Log.Error("AtlasTexLibrary can't handle this request: " + request.Type);
                throw new TextureToolsException("AtlasTexLibrary can't handle this request: " + request.Type);
            }
        }
Ejemplo n.º 2
0
        public void Execute(TexImage image, IRequest request)
        {
            if (image.GetType() != typeof(TexAtlas))
            {
                throw new TextureToolsException("The given texture must be an instance of TexAtlas.");
            }

            TexAtlas atlas = (TexAtlas)image;

            switch (request.Type)
            {
                case RequestType.AtlasCreation:
                    Create(atlas, (AtlasCreationRequest)request, 0);
                    break;
                case RequestType.AtlasExtraction:
                    Extract(atlas, (AtlasExtractionRequest)request);
                    break;
                case RequestType.AtlasUpdate:
                    Update(atlas, (AtlasUpdateRequest)request);
                    break;

                default:
                    Log.Error("AtlasTexLibrary can't handle this request: " + request.Type);
                    throw new TextureToolsException("AtlasTexLibrary can't handle this request: " + request.Type);
            }
        }
Ejemplo n.º 3
0
        public bool CanHandleRequest(TexImage image, IRequest request)
        {
            if (image.GetType() != typeof(TexAtlas))
            {
                return false;
            }

            switch (request.Type)
            {
                case RequestType.AtlasCreation:
                case RequestType.AtlasExtraction:
                case RequestType.AtlasUpdate:
                    return true;

                default:
                    return false;
            }
        }
Ejemplo n.º 4
0
        public bool CanHandleRequest(TexImage image, IRequest request)
        {
            if (image.GetType() != typeof(TexAtlas))
            {
                return(false);
            }

            switch (request.Type)
            {
            case RequestType.AtlasCreation:
            case RequestType.AtlasExtraction:
            case RequestType.AtlasUpdate:
                return(true);

            default:
                return(false);
            }
        }