Giter Club home page Giter Club logo

hearthstone.resourcegenerator's Introduction

HearthStone.ResourceGenerator


Task-based Asynchronous Pattern (TAP)

CREATED BY: Latency McLaughlin
UPDATED: 2/1/2018
FRAMEWORK: .NETFramework 4.5 - 4.7.1, .NETStandard2.0, .NETCoreApp2.0 (Latest)
LANGUAGE: C# (v7.0)
OUTPUT TYPE: Console Application + API
SUPPORTS: Visual Studio 2017, 2015, 2013, 2012, 2010, 2008
TAGS: .NET, NuGet, MyGet, API, C#, NUnit, Visual Studio
STATUS: hearthstone MyGet Build Status
LICENSE: License
CHAT: Chat
VERSION: Download

Screenshot

Output


Navigation


This article introduces an API which generates artifacts asynchronously; supporting deadlock protection, timeout, cancellation requests, and checkpointing.

ResourceGenerator is compiled as a library packaged for the MyGet marketplace. The project itself, supplies an application driver, and test suite, and source code.


This API has several benefits, such as:

-- ResourceGenerator benefits.

  • Supports centralized versioning.
  • Reusable code.
  • Decrease download time.
  • Optomizes performance of asynchronous code.
  • Packaged in NuGet format.
  • Reduce boilerplate installation and batch file code.
  • Async / Await support.
    Downloads for artifact images via web request calls run in parallel based on card set. Upon collection of the entire set, post-image processing is performed and images are bundled into resource files. Each image is rescaled and fixed for 130x34 8bpp PNG which is a compresssed format replacement to Bitmap which is not supported in .NET Core.

  • Cancellation Checkpointing
    Threading is handled by TPL and is wrapped by ORM-Monitor which handles the scheduling and asynchronous event dispatch.

This library is to be installed from MyGet:

There are plug-ins that this project uses as dependency from NuGet that are built-in and linked into the API.

Usage:

Now integrated into loader of DeckTracker.exe

ResourceGenerator.exe <path> <folder> <IsOverwriten> [msbuild]

Example #1

ResourceGenerator.exe "$(SolutionDir)Resources" Tiles 0
# Argument Type Description
1. Path String Target directory to generate the resource in.
2. Folder String Folder name that is created underneat the root directory .
3. IsOverwriten Boolean Forces downloading external images via async web request calls.
4. (optional)
DO_NOT_USE
String ["msbuild"] which is used for bootstrap post-build rules only.

Example #2

var tempDir = Path.GetTempPath();
var targetDir = Assembly.GetExecutingAssembly().Location;
			
Console.WriteLine(@"Running Resource Generator!");
ResourceGenerator.Program.Run(new []{ $"{tempDir}Resources", "Tiles", "0", "msbuild" });
Console.WriteLine($@"Sucessfully generated tiles in '{tempDir}Resources\Generated'");

Console.WriteLine($@"Copying Generated tiles from '{tempDir}Resources\Generated' to '{targetDir}Images\Tiles'");
XCopy.Run($@"{tempDir}Resources\Generated", $@"{targetDir}Images\Tiles");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.