auto-traffic-control
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

🛬 Auto Traffic Control

GitHub Workflow Status Version License

Homepage | Documentation | Community

Auto Traffic Control is a video game played by programming. The player's task is to create a program that can safely manage the airspace above two airports.

The game is designed to provide an open-ended sandbox that players can use to freely practice programming. The game provides a language-agnostic gRPC API, giving players free choice of programming language or paradigm.

This crate contains the auto-generated Node SDK for the game's gRPC API.

Usage

First, install auto-traffic-control as a new dependency:

npm install auto-traffic-control

Then, create a service client and send a request. Check out the documentation to learn about the different services and their endpoints.

The following TypeScript example queries the version of the game through the AtcService.

import {
  getCredentials,
  AtcServiceClient,
  GetVersionRequest,
  GetVersionResponse,
} from "auto-traffic-control";

const atcService = new AtcServiceClient("localhost:4747", getCredentials());

atcService.getVersion(
  new GetVersionRequest(),
  (err, response: GetVersionResponse) => {
    if (err != null) {
      throw err;
    }

    const version = response.getVersion();

    if (version != null) {
      let versionString = [
        version.getMajor(),
        version.getMinor(),
        version.getPatch(),
      ].join(".");

      if (version.getPre() !== "") {
        versionString = versionString.concat(version.getPre());
      }

      console.log(`Auto Traffic Control is running version '${versionString}'`);
    } else {
      throw new Error("Requesting the version returned an empty response.");
    }
  }
);

Tutorial

The documentation for the game contains an in-depth tutorial on how to play the game with TypeScript. Check out the tutorial for more examples using this package:

https://auto-traffic-control.com/docs/tutorial

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Readme

Keywords

Package Sidebar

Install

npm i auto-traffic-control

Weekly Downloads

0

Version

0.3.2

License

(MIT OR Apache-2.0)

Unpacked Size

259 kB

Total Files

30

Last publish

Collaborators

  • jdno