aboutsummaryrefslogtreecommitdiff
path: root/games/rstnode/rst-core/src/wire/game/action.rs
blob: 22ab7ce6868eb54a156c2bde7c2c475f9ead9669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::data::{NodeId, Upgrade};
use serde::{Deserialize, Serialize};

/// All actions that a user can trigger via the UI
#[derive(Serialize, Deserialize)]
pub enum Action {
    /// Cancel the running action
    Cancel(NodeId),
    /// Start a capture action
    Capture { from: NodeId, to: NodeId },
    /// Set the compute targets
    Compute { from: NodeId, to: Vec<NodeId> },
    /// Set to payload analysis mode
    Payload(NodeId),
    /// Send an exploit across the network
    Reset {
        from: NodeId,
        to: NodeId,
        exp: Exploit,
    },
    /// Try to upgrade the node to a level
    Upgrade { node: NodeId, level: Upgrade },
}

/// A type of exploit a node can start running
#[derive(Serialize, Deserialize)]
pub enum Exploit {
    Reset,
    CNS,
    Nitm,
    Virus,
    TakeOver,
}