Description

A Vindinum client for D based AIs

Package Information

Version0.0.1 (2014-Sep-11)
Repository https://github.com/dymk/vindinium-client
LicenseBSL-1.0
CopyrightCopyright © 2014, Dylan Knutson
AuthorsDylan Knutson
Registered byDylan Knutson
Dependencies

std_data_json

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

vindinium-client

Simple Vindinium client library for D

See https://github.com/dymk/vindinium-starter-d for an example project using this

To create a game, use the Vindinium struct:

  • this(string key, string server, Mode mode, uint turns, string map)

where Mode is defined as:

enum Mode {
    Training,
    Arena
}

Call .connect() on the struct to create a VindiniumGame:

  import vindinium;
  auto vin = Vindinium(key, server, mode, turns, map);
  auto game = vin.connect();

Send commands to the client until the game is finished:

  while(!game.finished) {
    auto cmd = uniform!(VindiniumGame.Command);
    game.send_command(cmd);

    writefln("Turn %3d: Issued command: %s", game.turn, cmd);
  }

Access the current game state (data structures are in comm.d) through .state:

  auto board = game.state.game.board;
  auto hero  = game.state.hero;
  // etc

Available versions

0.0.1 ~master