-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
331 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Deploy (Dev) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deployment: | ||
name: Deployment | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: deploy-dev | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.JP_SERVER_HOSTNAME }} | ||
username: ${{ secrets.JP_SERVER_USER }} | ||
password: ${{ secrets.JP_SERVER_PASSWORD }} | ||
script: | | ||
cd /mafia-app/dev | ||
./update.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use std::collections::HashSet; | ||
|
||
use crate::game::{player::PlayerReference, Game}; | ||
|
||
|
||
#[derive(Default)] | ||
pub struct Confused{ | ||
players: HashSet<PlayerReference> | ||
} | ||
impl Confused{ | ||
fn confused<'a>(game: &'a Game)->&'a Self{ | ||
&game.confused | ||
} | ||
fn confused_mut<'a>(game: &'a mut Game)->&'a mut Self{ | ||
&mut game.confused | ||
} | ||
|
||
|
||
pub fn add_player(game: &mut Game, player: PlayerReference){ | ||
let intoxicated = Self::confused_mut(game); | ||
intoxicated.players.insert(player); | ||
} | ||
pub fn remove_player(game: &mut Game, player: PlayerReference){ | ||
let intoxicated = Self::confused_mut(game); | ||
intoxicated.players.remove(&player); | ||
} | ||
|
||
pub fn is_intoxicated(game: &Game, player: PlayerReference)->bool{ | ||
let intoxicated = Self::confused(game); | ||
intoxicated.players.contains(&player) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ pub mod pitchfork; | |
pub mod poison; | ||
pub mod revealed_group; | ||
pub mod detained; | ||
|
||
pub mod confused; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.