From c9084a6aa4b234fdb77b838bc1fb903145a6b88f Mon Sep 17 00:00:00 2001 From: a14m Date: Sun, 4 Apr 2021 01:08:05 +0200 Subject: Add the skeleton of the generators modules/methods --- CLI/rust/src/game_of_life/generators.rs | 4 ++++ CLI/rust/src/game_of_life/generators/input.rs | 12 ++++++++++++ CLI/rust/src/game_of_life/generators/seed.rs | 10 ++++++++++ 3 files changed, 26 insertions(+) create mode 100644 CLI/rust/src/game_of_life/generators.rs create mode 100644 CLI/rust/src/game_of_life/generators/input.rs create mode 100644 CLI/rust/src/game_of_life/generators/seed.rs diff --git a/CLI/rust/src/game_of_life/generators.rs b/CLI/rust/src/game_of_life/generators.rs new file mode 100644 index 0000000..16bd7c3 --- /dev/null +++ b/CLI/rust/src/game_of_life/generators.rs @@ -0,0 +1,4 @@ +/// Generate a new Universe/Board from a parsed local file or remote URL/file +pub(crate) mod input; +/// Generate a new Universe/Board from a seed number +pub(crate) mod seed; diff --git a/CLI/rust/src/game_of_life/generators/input.rs b/CLI/rust/src/game_of_life/generators/input.rs new file mode 100644 index 0000000..2ce8944 --- /dev/null +++ b/CLI/rust/src/game_of_life/generators/input.rs @@ -0,0 +1,12 @@ +use crate::game_of_life::opts::Opts; +use crate::game_of_life::universe::Universe; + +/// Generate a new Universe/Board with a parsed local file or remote URL/file +/// +/// If a URL is provided as an input (starting with http/ftp) the URL/File will be downloaded +/// and parsed to generate a seeding input for the simulation +/// otherwise, it'll be assumed that it's a path to a local file that will be parsed, and +/// used as the seeding input +pub(crate) fn new(opts: Opts) -> Universe { + unimplemented!() +} diff --git a/CLI/rust/src/game_of_life/generators/seed.rs b/CLI/rust/src/game_of_life/generators/seed.rs new file mode 100644 index 0000000..8a10ac0 --- /dev/null +++ b/CLI/rust/src/game_of_life/generators/seed.rs @@ -0,0 +1,10 @@ +use crate::game_of_life::opts::Opts; +use crate::game_of_life::universe::Universe; + +/// Generate a new Universe/Board from a seed number +/// +/// The generation of the seed should be stable across different machines +/// using the same language package, version, width and height. +pub(crate) fn new(opts: Opts) -> Universe { + unimplemented!() +} -- cgit v1.2.3