core

Core library for implementing Battle of the Centerländ.

Installation

To be able to use this crate, add it to your Cargo.toml:

toml [dependencies] botc-core = { package = "uulm-sopra23-group03-core", version = "0.1" }

While the package is named uulm-sopra23-group03-core this adds it to your project as botc-core.

Features

There are features not enabled by default for specific use cases.

toml [dependencies] botc-core = { package = "uulm-sopra23-group03-core", version = "0.1", features = ["client"] }

To enable a feature, specify it with the dependency in your Cargo.toml:

| Feature | Description | |----------|------------------------------------------------------------------------------------------------------------------------------| | client | Enables sink/stream based client functionality with the client module. Can be used for implementing a client for the game. | | ai | Enables the ai with training data structures. |


Build

Prerequisites

Everything can be installed with rustup:

```

Update rustup's information.

rustup update

Install the stable Rust toolchain (if not already present).

rustup toolchain add stable

Add rustfmt.

rustup component add rustfmt

Add clippy.

rustup component add clippy ```

Testing

Code Formatting

This should not output anything when the code is formatted corretcly:

cargo fmt --check

Run the following to automatically format the Rust code:

cargo fmt

Code Analysis

Run the following to check the code for common mistakes:

cargo clippy --all-features

Tests

Run tests with the following:

cargo test --all-features

Documentation

Documentation for the local version of the crate can be built and opened with the following:

cargo doc --all-features --open


Development

Workflow

  1. Create issue.
  2. Add issue to milestone.
  3. Add labels.
  4. Add time estimate.
  5. Create merge request from issue.
  6. pull/fetch local copy.
  7. checkout to branch created for merge reuqest.
  8. Solve issue.
  9. Add tests if neccessary.
  10. Ensure that build, format, analysis and tests are correct (see Testing).
  11. add, commit and push changes.
  12. Watch for CI pipeline.
  13. Add reviewer for merge request.
  14. Wait for feedback, apply changes when neccessary.
  15. Merge when approved.
  16. Set/update time spent in issue.

Branches

There are two important branches: main and dev.

main contains the latest stable state which will then be tagged with releases.

dev contains the current development state. From and to this branch, merge requests are created.