fixed client

This commit is contained in:
AlphaCodingPilot 2023-08-21 00:29:02 +02:00
commit cee3d315d8
5 changed files with 7 additions and 6 deletions

View file

@ -5,7 +5,7 @@ use macroquad::hash;
use macroquad::math::{bool, vec2};
use macroquad::ui::root_ui;
use server::action::Action;
use server::content::advances::get_all_advances;
use server::content::advances::get_all;
use server::game::Game;
use server::playing_actions::PlayingAction;
use server::resource_pile::AdvancePaymentOptions;
@ -29,7 +29,7 @@ impl AdvancePayment {
AdvancePayment {
name: name.to_string(),
payment: AdvancePayment::new_payment(
&p.resources().get_advance_payment_options(cost),
&p.resources.get_advance_payment_options(cost),
cost,
),
cost,
@ -76,7 +76,7 @@ pub fn show_advance_menu(game: &Game, player_index: usize) -> StateUpdate {
let mut updates = StateUpdates::new();
root_ui().window(hash!(), vec2(20., 900.), vec2(400., 200.), |ui| {
for a in get_all_advances() {
for a in get_all() {
let name = a.name;
let p = game.get_player(player_index);
if can_play_action(game) && p.can_advance(&name) {

View file

@ -180,7 +180,7 @@ impl ConstructionPayment {
.clone(),
};
let payment_options = p.resources().get_payment_options(&cost);
let payment_options = p.resources.get_payment_options(&cost);
let payment = ConstructionPayment::new_payment(&payment_options);

View file

@ -68,7 +68,7 @@ fn increase_happiness_new_steps(
.expect("invalid steps");
}
new_total += new_cost;
if player.resources().can_afford(&new_total) {
if player.resources.can_afford(&new_total) {
return Some((new_steps, new_total));
}
}

View file

@ -69,7 +69,7 @@ pub fn show_wonders(game: &Game, player_index: usize) {
pub fn show_resources(game: &Game, player_index: usize) {
let player = game.get_player(player_index);
let r: &ResourcePile = player.resources();
let r: &ResourcePile = &player.resources;
let mut i: f32 = 0.;
let mut res = |label: String| {

View file

@ -1,4 +1,5 @@
cd ..\client
code .
cargo fmt
cargo clippy
cd ..\server