From 7e21d9b274cfcffec8604b73224046d4f60c34a7 Mon Sep 17 00:00:00 2001 From: Isaac Mills Date: Sun, 10 Mar 2024 21:34:38 -0400 Subject: [PATCH] Create a design complexity document --- src/design_complexity.rs | 45 ++++++++++++++++++++++++++++++++++++++++ src/main.rs | 1 + 2 files changed, 46 insertions(+) create mode 100644 src/design_complexity.rs diff --git a/src/design_complexity.rs b/src/design_complexity.rs new file mode 100644 index 0000000..82a215d --- /dev/null +++ b/src/design_complexity.rs @@ -0,0 +1,45 @@ +//! # Design/Program complexity +//! +//! - We use the [`heapless::Vec`] array type to store a fixed number of +//! [`ActionCard`]s for the player in the [`Player`] +//! type +//! - We use the [`heapless::Vec`] array type to store a fixed number of +//! [`Player`]s in the [`SituationTable`] type +//! +//! - We're going to use a separate program to design and create a file for the +//! [`ActionCard`]s and the [`SituationCard`]s, which will be loaded when the game +//! begins. +//! +//! - Our loops are going to be managed by [`bevy`]'s [`ecs`]. +//! +//! - The [`ecs`] is going to be managing our objects as data records +//! - Every object marked with [`Resource`] or [`Component`] can be +//! a record stored by the engine +//! +//! - We're going to need to search for [`ActionCard`]s and [`SituationCard`]s in an +//! array that we load from a file in order to be able to use them. +//! - [`ActionCard`]s specifically will also have an associated [`CardType`] which will +//! need to be taken into account during the search +//! +//! - Selection statements such as `match` will be used all over our codebase to +//! select things based on associated data such as [`Position`]s +//! +//! - We're going to sort the [`ActionCard`]s in the [`Player`]s hand by it's influence +//! cost +//! +//! - User defined methods are everywhere in this codebase, most of which interact with +//! the [`ecs`] +//! +//! - User defined objects are also everywhere, and will be used to build the +//! [`Component`]s and [`Resource`]s the game will need to exist + +#![allow(unused_imports)] + +use crate::cards::ActionCard; +use crate::cards::CardType; +use crate::cards::SituationCard; +use crate::player::Player; +use crate::player::Position; +use crate::rooms::SituationTable; +use bevy::ecs; +use bevy::prelude::{Component, Resource}; diff --git a/src/main.rs b/src/main.rs index 7c9f554..ae8d941 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ use bevy_asset_loader::loading_state::{ use tracing_subscriber::EnvFilter; mod cards; +mod design_complexity; mod logo; mod menu; mod networking;