Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheelax committed Mar 8, 2024
1 parent 54f2214 commit be8773e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 35 deletions.
32 changes: 9 additions & 23 deletions src/models/tile.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,7 @@ fn _connected_iter(
}
return _connected_iter(target, owner, tiles, ref visiteds, ref unvisiteds);
},
Option::None => {
return false;
},
Option::None => { return false; },
}
}

Expand All @@ -509,9 +507,7 @@ fn _owned_dedup(ref array: Span<u8>, tiles: Span<Tile>, drops: Span<u8>, owner:
result.append(element);
};
},
Option::None => {
break;
},
Option::None => { break; },
};
};
result.span()
Expand Down Expand Up @@ -665,9 +661,7 @@ mod tests {
break index;
};
},
Option::None => {
panic(array!['Tile: foreigner not found']);
},
Option::None => { panic(array!['Tile: foreigner not found']); },
};
};
let mut to = TileTrait::new(GAME_ID, *index, 2, PLAYER_1);
Expand Down Expand Up @@ -771,14 +765,10 @@ mod tests {
let mut allies = config::neighbors(attacker.id).expect('Tile: invalid id');
let index = loop {
match allies.pop_front() {
Option::Some(index) => {
if index != @defender.id {
break index;
};
},
Option::None => {
panic(array!['Tile: ally not found']);
},
Option::Some(index) => { if index != @defender.id {
break index;
}; },
Option::None => { panic(array!['Tile: ally not found']); },
};
};
let mut ally = TileTrait::new(GAME_ID, *index, 2, PLAYER_1);
Expand Down Expand Up @@ -862,9 +852,7 @@ mod tests {
break index;
};
},
Option::None => {
panic(array!['Tile: foreigner not found']);
},
Option::None => { panic(array!['Tile: foreigner not found']); },
};
};
let mut foreigner = TileTrait::new(GAME_ID, *index, 2, PLAYER_2);
Expand Down Expand Up @@ -958,9 +946,7 @@ mod tests {
break index;
};
},
Option::None => {
panic(array!['Tile: ally not found']);
},
Option::None => { panic(array!['Tile: ally not found']); },
};
};
attacker.attack(1, ref defender, 'ATTACK');
Expand Down
16 changes: 4 additions & 12 deletions src/systems/play.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ mod play {
battle.tx_hash = get_tx_info().unbox().transaction_hash;
emit!(world, battle);
},
Option::None => {
break;
},
Option::None => { break; },
};
};
}
Expand Down Expand Up @@ -457,9 +455,7 @@ mod play {
let hand = HandTrait::load(player);
deck.remove(hand.cards.span());
},
Option::None => {
break;
},
Option::None => { break; },
};
};

Expand Down Expand Up @@ -498,12 +494,8 @@ mod play {
let mut tiles: Array<Tile> = array![];
loop {
match player_tiles.pop_front() {
Option::Some(tile) => {
tiles.append(*tile);
},
Option::None => {
break;
},
Option::Some(tile) => { tiles.append(*tile); },
Option::None => { break; },
};
};
tiles.span()
Expand Down

0 comments on commit be8773e

Please sign in to comment.