Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/plugin2026/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ impl Board {
Self { map }
}

pub fn __str__(&self) -> String {self.to_string()}
pub fn __repr__(&self) -> String {format!("{:?}", self)}
pub fn __eq__(&self, other: &Board) -> bool {self == other}
pub fn __ne_(&self, other: &Board) -> bool {self != other}

pub fn deepcopy(&self) -> Board {self.clone()}
fn __str__(&self) -> String {self.to_string()}
fn __repr__(&self) -> String {format!("{:?}", self)}
fn __eq__(&self, other: &Board) -> bool {self == other}
fn __ne__(&self, other: &Board) -> bool {self != other}
fn deepcopy(&self) -> Board {self.clone()}

pub fn get_field(&self, position: &Coordinate) -> Option<FieldType> {

Expand Down
8 changes: 4 additions & 4 deletions src/plugin2026/field_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ pub enum FieldType {

#[pymethods]
impl FieldType {
pub fn __str__(&self) -> String {self.to_string()}
pub fn __repr__(&self) -> String {format!("{:?}", self)}
pub fn __eq__(&self, other: &FieldType) -> bool {self == other}
pub fn __ne_(&self, other: &FieldType) -> bool {self != other}
fn __str__(&self) -> String {self.to_string()}
fn __repr__(&self) -> String {format!("{:?}", self)}
fn __eq__(&self, other: &FieldType) -> bool {self == other}
fn __ne__(&self, other: &FieldType) -> bool {self != other}

pub fn get_value(&self) -> usize {
match self {
Expand Down
11 changes: 5 additions & 6 deletions src/plugin2026/game_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ impl GameState {
}
}

pub fn __str__(&self) -> String {self.to_string()}
pub fn __repr__(&self) -> String {format!("{:?}", self)}
pub fn __eq__(&self, other: &GameState) -> bool {self == other}
pub fn __ne__(&self, other: &GameState) -> bool {self != other}

pub fn deepcopy(&self) -> GameState {self.clone()}
fn __str__(&self) -> String {self.to_string()}
fn __repr__(&self) -> String {format!("{:?}", self)}
fn __eq__(&self, other: &GameState) -> bool {self == other}
fn __ne__(&self, other: &GameState) -> bool {self != other}
fn deepcopy(&self) -> GameState {self.clone()}

pub fn set_board_field(&mut self, position: &Coordinate, field: FieldType) -> Result<(), PyErr> {
let x = position.x as usize;
Expand Down
11 changes: 5 additions & 6 deletions src/plugin2026/move.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ impl Move {
}
}

pub fn __str__(&self) -> String {self.to_string()}
pub fn __repr__(&self) -> String {format!("{:?}", self)}
pub fn __eq__(&self, other: &Move) -> bool {self == other}
pub fn __ne_(&self, other: &Move) -> bool {self != other}

pub fn deepcopy(&self) -> Move {self.clone()}
fn __str__(&self) -> String {self.to_string()}
fn __repr__(&self) -> String {format!("{:?}", self)}
fn __eq__(&self, other: &Move) -> bool {self == other}
fn __ne__(&self, other: &Move) -> bool {self != other}
fn deepcopy(&self) -> Move {self.clone()}
}

impl std::fmt::Display for Move {
Expand Down
12 changes: 6 additions & 6 deletions src/plugin2026/utils/coordinate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ impl Coordinate {
}
}

pub fn __str__(&self) -> String {self.to_string()}
pub fn __repr__(&self) -> String {format!("{:?}", self)}
pub fn __eq__(&self, other: &Coordinate) -> bool {self == other}
pub fn __ne_(&self, other: &Coordinate) -> bool {self != other}

pub fn deepcopy(&self) -> Coordinate {*self}
fn __str__(&self) -> String {self.to_string()}
fn __repr__(&self) -> String {format!("{:?}", self)}
fn __eq__(&self, other: &Coordinate) -> bool {self == other}
fn __ne__(&self, other: &Coordinate) -> bool {self != other}
fn deepcopy(&self) -> Coordinate {*self}

pub fn add_vector(&self, vector: &Vector) -> Coordinate {
Coordinate {
Expand All @@ -35,6 +34,7 @@ impl Coordinate {
}

pub fn add_vector_mut(&mut self, vector: &Vector) {

self.x += vector.delta_x;
self.y += vector.delta_y;
}
Expand Down
11 changes: 5 additions & 6 deletions src/plugin2026/utils/direction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ pub enum Direction {

#[pymethods]
impl Direction {
pub fn __str__(&self) -> String {self.to_string()}
pub fn __repr__(&self) -> String {format!("{:?}", self)}
pub fn __eq__(&self, other: &Direction) -> bool {self == other}
pub fn __ne_(&self, other: &Direction) -> bool {self != other}

pub fn deepcopy(&self) -> Direction {*self}
fn __str__(&self) -> String {self.to_string()}
fn __repr__(&self) -> String {format!("{:?}", self)}
fn __eq__(&self, other: &Direction) -> bool {self == other}
fn __ne__(&self, other: &Direction) -> bool {self != other}
fn deepcopy(&self) -> Direction {*self}

#[staticmethod]
pub fn from_vector(vector: &Vector) -> Option<Direction> {
Expand Down
8 changes: 4 additions & 4 deletions src/plugin2026/utils/team.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pub enum TeamEnum {

#[pymethods]
impl TeamEnum {
pub fn __str__(&self) -> String {self.to_string()}
pub fn __repr__(&self) -> String {format!("{:?}", self)}
pub fn __eq__(&self, other: &TeamEnum) -> bool {self == other}
pub fn __ne_(&self, other: &TeamEnum) -> bool {self != other}
fn __str__(&self) -> String {self.to_string()}
fn __repr__(&self) -> String {format!("{:?}", self)}
fn __eq__(&self, other: &TeamEnum) -> bool {self == other}
fn __ne__(&self, other: &TeamEnum) -> bool {self != other}

pub fn get_fish_types(&self) -> Vec<FieldType> {
match self {
Expand Down
11 changes: 5 additions & 6 deletions src/plugin2026/utils/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ impl Vector {
}
}

pub fn __str__(&self) -> String {self.to_string()}
pub fn __repr__(&self) -> String {format!("{:?}", self)}
pub fn __eq__(&self, other: &Vector) -> bool {self == other}
pub fn __ne_(&self, other: &Vector) -> bool {self != other}

pub fn deepcopy(&self) -> Vector {*self}
fn __str__(&self) -> String {self.to_string()}
fn __repr__(&self) -> String {format!("{:?}", self)}
fn __eq__(&self, other: &Vector) -> bool {self == other}
fn __ne__(&self, other: &Vector) -> bool {self != other}
fn deepcopy(&self) -> Vector {*self}

pub fn add_vector(&self, other: &Vector) -> Vector {
Vector {
Expand Down