forked from gear-foundation/dapps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tic-tac-toe to sails (gear-foundation#424)
- Loading branch information
1 parent
ab75078
commit 556f1c9
Showing
26 changed files
with
1,844 additions
and
261 deletions.
There are no files selected for viewing
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,17 @@ | ||
[package] | ||
name = "tic-tac-toe-app" | ||
version.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
gstd = { workspace = true, features = ["debug"] } | ||
sails-rs.workspace = true | ||
schnorrkel.workspace = true | ||
|
||
[dev-dependencies] | ||
gtest.workspace = true | ||
gear-core.workspace = true | ||
gclient.workspace = true | ||
tic-tac-toe-wasm = { path = "../wasm" } | ||
tokio = "1" |
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,26 @@ | ||
#![no_std] | ||
#![allow(clippy::new_without_default)] | ||
|
||
use sails_rs::prelude::*; | ||
mod services; | ||
use crate::services::game::utils::Config; | ||
use services::game::GameService; | ||
use services::session::SessionService; | ||
pub struct Program(()); | ||
|
||
#[program] | ||
impl Program { | ||
pub async fn new(config: Config, dns_id_and_name: Option<(ActorId, String)>) -> Self { | ||
GameService::init(config, dns_id_and_name).await; | ||
SessionService::init(); | ||
Self(()) | ||
} | ||
|
||
pub fn tic_tac_toe(&self) -> GameService { | ||
GameService::new() | ||
} | ||
|
||
pub fn session(&self) -> SessionService { | ||
SessionService::new() | ||
} | ||
} |
Oops, something went wrong.