Finish effect data type
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				ci/woodpecker/push/woodpecker Pipeline was successful
				
			
		
		
	
	
		
	
		
			All checks were successful
		
		
	
	ci/woodpecker/push/woodpecker Pipeline was successful
				
			This commit is contained in:
		
					parent
					
						
							
								7e21d9b274
							
						
					
				
			
			
				commit
				
					
						b551179ba7
					
				
			
		
					 3 changed files with 11 additions and 5 deletions
				
			
		
							
								
								
									
										12
									
								
								src/cards.rs
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								src/cards.rs
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,12 +1,13 @@
 | 
			
		|||
use std::borrow::Cow;
 | 
			
		||||
 | 
			
		||||
use serde::Deserialize;
 | 
			
		||||
use yoke::Yokeable;
 | 
			
		||||
 | 
			
		||||
use super::player::Position;
 | 
			
		||||
 | 
			
		||||
/// A card in a players deck which can apply an effect
 | 
			
		||||
/// to the game or advance a solution
 | 
			
		||||
#[derive(Yokeable)]
 | 
			
		||||
#[derive(Yokeable, Deserialize)]
 | 
			
		||||
pub struct ActionCard<'a> {
 | 
			
		||||
    /// How much influence the card will cost to play
 | 
			
		||||
    influence: i32,
 | 
			
		||||
| 
						 | 
				
			
			@ -21,7 +22,7 @@ pub struct ActionCard<'a> {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
/// A card which must be solved by someone on the politburo
 | 
			
		||||
#[derive(Yokeable)]
 | 
			
		||||
#[derive(Yokeable, Deserialize)]
 | 
			
		||||
pub struct SituationCard<'a> {
 | 
			
		||||
    /// Points associated with the card
 | 
			
		||||
    points: i32,
 | 
			
		||||
| 
						 | 
				
			
			@ -43,5 +44,8 @@ pub enum CardType {
 | 
			
		|||
    Position(Position),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// ??
 | 
			
		||||
pub enum Effect {}
 | 
			
		||||
#[derive(Deserialize)]
 | 
			
		||||
pub struct Effect {
 | 
			
		||||
    effect: char,
 | 
			
		||||
    magnitude: f32,
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,8 +11,8 @@ use libp2p::{
 | 
			
		|||
use rand::Rng;
 | 
			
		||||
use serde::{Deserialize, Serialize};
 | 
			
		||||
use std::{borrow::Cow, hash::Hash};
 | 
			
		||||
use std::{cell::OnceCell, sync::OnceLock, time::Duration};
 | 
			
		||||
use std::{collections::hash_map::DefaultHasher, hash::Hasher};
 | 
			
		||||
use std::{sync::OnceLock, time::Duration};
 | 
			
		||||
use yoke::{Yoke, Yokeable};
 | 
			
		||||
 | 
			
		||||
#[derive(NetworkBehaviour)]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,10 @@
 | 
			
		|||
use serde::Deserialize;
 | 
			
		||||
use yoke::Yoke;
 | 
			
		||||
 | 
			
		||||
use crate::cards::ActionCard;
 | 
			
		||||
 | 
			
		||||
/// The players position on the Politburo
 | 
			
		||||
#[derive(Deserialize)]
 | 
			
		||||
pub enum Position {
 | 
			
		||||
    /// Very direct, aggressive. Focuses on generating influence.
 | 
			
		||||
    /// Public opinion suffers as a result.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue