Skip to content

Commit

Permalink
update the api
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed Dec 14, 2023
1 parent 7854a9e commit 7edc667
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 15 deletions.
81 changes: 77 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = ["crates/*"]

[workspace.dependencies]
byondapi = { git = "https://github.com/jupyterkat/byondapi-rs", package = "byondapi" }
byondapi = "0.3.1"
byondapi-binds = { path = "./crates/byondapi-binds" }

[package]
Expand Down Expand Up @@ -39,7 +39,7 @@ crate-type = ["cdylib"]
[dependencies]
auxcallback = { path = "./crates/auxcallback" }
byondapi-binds = { path = "./crates/byondapi-binds" }
byondapi = "0.3.0"
byondapi = "0.3.1"
itertools = "0.12.0"
rayon = "1.8.0"
float-ord = "0.3.2"
Expand Down
2 changes: 1 addition & 1 deletion crates/auxcallback/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::convert::TryInto;

use byondapi::{prelude::*, typecheck_trait::ByondTypeCheck};
use byondapi::prelude::*;

use coarsetime::{Duration, Instant};

Expand Down
2 changes: 1 addition & 1 deletion src/gas/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use auxcallback::byond_callback_sender;
use byondapi::{prelude::*, typecheck_trait::ByondTypeCheck};
use byondapi::prelude::*;

use fxhash::FxBuildHasher;

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub mod init_shutdown;

mod parser;

use byondapi::{map::byond_length, prelude::*, typecheck_trait::ByondTypeCheck};
use byondapi::{map::byond_length, prelude::*};

use gas::{
amt_gases, constants, gas_idx_from_string, gas_idx_from_value, gas_idx_to_id, tot_gases, types,
Expand Down
2 changes: 1 addition & 1 deletion src/reaction.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[cfg(feature = "reaction_hooks")]
mod hooks;

use byondapi::{prelude::*, typecheck_trait::ByondTypeCheck};
use byondapi::prelude::*;

use crate::gas::{gas_idx_to_id, total_num_gases, GasIDX, Mixture};

Expand Down
1 change: 0 additions & 1 deletion src/turfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ mod superconduct;

use byondapi::prelude::*;

use byondapi::typecheck_trait::ByondTypeCheck;
use rayon::prelude::*;

use crate::{constants::*, gas::Mixture, GasArena};
Expand Down
8 changes: 4 additions & 4 deletions src/turfs/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ fn fdm(
.for_each(|(id, diffs)| {
let sender = byond_callback_sender();
drop(sender.try_send(Box::new(move || {
let turf = ByondValue::new_ref(0x01, id);
let turf = ByondValue::new_ref(ValueType::Turf, id);
for (id, diff) in diffs.iter().copied() {
if id != 0 {
let enemy_tile = ByondValue::new_ref(0x01, id);
let enemy_tile = ByondValue::new_ref(ValueType::Turf, id);
if diff > 5.0 {
turf.call_id(
byond_string!("consider_pressure_difference"),
Expand Down Expand Up @@ -389,7 +389,7 @@ fn post_process() {

if should_react {
drop(sender.try_send(Box::new(move || {
let turf = ByondValue::new_ref(0x01, id);
let turf = ByondValue::new_ref(ValueType::Turf, id);
turf.read_var_id(byond_string!("air"))?
.call_id(byond_string!("react"), &[turf])?;
Ok(())
Expand All @@ -398,7 +398,7 @@ fn post_process() {

if should_update_vis {
drop(sender.send(Box::new(move || {
let turf = ByondValue::new_ref(0x01, id);
let turf = ByondValue::new_ref(ValueType::Turf, id);
update_visuals(turf)?;
Ok(())
})));
Expand Down

0 comments on commit 7edc667

Please sign in to comment.