move MAX_HEALTH into main

This commit is contained in:
Max Känner 2024-09-30 21:49:43 +02:00
parent 39e84b3783
commit 7eb6eff65a
2 changed files with 4 additions and 4 deletions

View File

@ -14,9 +14,7 @@ use log::info;
use rand::seq::SliceRandom;
use serde_json::{json, Value};
use crate::{Action, Battlesnake, Board, Direction, Game};
const MAX_HEALTH: i32 = 100;
use crate::{Action, Battlesnake, Board, Direction, Game, MAX_HEALTH};
impl Battlesnake {
fn possible_actions_without_heads<'a>(

View File

@ -12,6 +12,8 @@ use std::env;
mod logic;
const MAX_HEALTH: i32 = 100;
// API and Response Objects
// See https://docs.battlesnake.com/api
@ -159,7 +161,7 @@ pub struct Battlesnake {
// customizations: {color, head, tail}
}
#[derive(Debug, PartialEq, Eq, Clone, Copy, Deserialize, Serialize)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Deserialize, Serialize)]
pub struct Coord {
x: i32,
y: i32,