Added rules for Water
This commit is contained in:
parent
6c423f69c2
commit
45bf018375
|
@ -40,10 +40,16 @@ pub struct FallingSandRules {
|
|||
|
||||
impl Default for FallingSandRules {
|
||||
fn default() -> Self {
|
||||
// Pre-computed air-sand rules
|
||||
// Pre-computed rules
|
||||
// I should really start building a tool for this instead of manually calculating it huh
|
||||
let rule_config = RuleConfig {
|
||||
element_groups: vec![vec![Element::Air], vec![Element::Sand]],
|
||||
element_groups: vec![
|
||||
vec![Element::Air],
|
||||
vec![Element::Sand],
|
||||
vec![Element::Water],
|
||||
],
|
||||
rules: vec![
|
||||
// Air/Sand
|
||||
([0, 1, 0, 0], [0, 0, 0, 1]),
|
||||
([0, 1, 0, 1], [0, 0, 1, 1]),
|
||||
([0, 1, 1, 0], [0, 0, 1, 1]),
|
||||
|
@ -53,6 +59,62 @@ impl Default for FallingSandRules {
|
|||
([1, 1, 0, 0], [0, 0, 1, 1]),
|
||||
([1, 1, 0, 1], [0, 1, 1, 1]),
|
||||
([1, 1, 1, 0], [1, 0, 1, 1]),
|
||||
// Air/Water
|
||||
([0, 2, 0, 0], [0, 0, 0, 2]),
|
||||
([0, 2, 0, 2], [0, 0, 2, 2]),
|
||||
([0, 2, 2, 0], [0, 0, 2, 2]),
|
||||
([2, 0, 0, 0], [0, 0, 2, 0]),
|
||||
([2, 0, 0, 2], [0, 0, 2, 2]),
|
||||
([2, 0, 2, 0], [0, 0, 2, 2]),
|
||||
([2, 2, 0, 0], [0, 0, 2, 2]),
|
||||
([2, 2, 0, 2], [0, 2, 2, 2]),
|
||||
([2, 2, 2, 0], [2, 0, 2, 2]),
|
||||
([0, 2, 2, 2], [2, 0, 2, 2]),
|
||||
([2, 0, 2, 2], [0, 2, 2, 2]),
|
||||
// Air/Sand/Water
|
||||
([0, 1, 0, 2], [0, 0, 2, 1]),
|
||||
([0, 1, 1, 2], [0, 2, 1, 1]),
|
||||
([0, 1, 2, 0], [0, 0, 2, 1]),
|
||||
([0, 1, 2, 1], [2, 0, 1, 1]),
|
||||
([0, 1, 2, 2], [0, 2, 2, 1]),
|
||||
([0, 2, 0, 1], [0, 0, 2, 1]),
|
||||
([0, 2, 1, 0], [0, 0, 1, 2]),
|
||||
([0, 2, 1, 1], [2, 0, 1, 1]),
|
||||
([0, 2, 1, 2], [2, 0, 1, 2]),
|
||||
([0, 2, 2, 1], [2, 0, 2, 1]),
|
||||
([1, 0, 0, 2], [0, 0, 1, 2]),
|
||||
([1, 0, 1, 2], [0, 2, 1, 1]),
|
||||
([1, 0, 2, 0], [0, 0, 1, 2]),
|
||||
([1, 0, 2, 1], [2, 0, 1, 1]),
|
||||
([1, 0, 2, 2], [2, 0, 1, 2]),
|
||||
([1, 1, 0, 2], [0, 2, 1, 1]),
|
||||
([1, 1, 1, 2], [1, 2, 1, 1]),
|
||||
([1, 1, 2, 0], [2, 0, 1, 1]),
|
||||
([1, 1, 2, 1], [2, 1, 1, 1]),
|
||||
([1, 1, 2, 2], [2, 2, 1, 1]),
|
||||
([1, 2, 0, 0], [0, 0, 1, 2]),
|
||||
([1, 2, 0, 1], [0, 2, 1, 1]),
|
||||
([1, 2, 0, 2], [0, 2, 1, 2]),
|
||||
([1, 2, 1, 0], [0, 2, 1, 1]),
|
||||
([1, 2, 1, 2], [2, 2, 1, 1]),
|
||||
([1, 2, 2, 0], [0, 2, 1, 2]),
|
||||
([1, 2, 2, 1], [2, 2, 1, 1]),
|
||||
([1, 2, 2, 2], [2, 2, 1, 2]),
|
||||
([2, 0, 0, 1], [0, 0, 2, 1]),
|
||||
([2, 0, 1, 0], [0, 0, 1, 2]),
|
||||
([2, 0, 1, 1], [0, 2, 1, 1]),
|
||||
([2, 0, 1, 2], [0, 2, 1, 2]),
|
||||
([2, 0, 2, 1], [0, 2, 2, 1]),
|
||||
([2, 1, 0, 0], [0, 0, 2, 1]),
|
||||
([2, 1, 0, 1], [2, 0, 1, 1]),
|
||||
([2, 1, 0, 2], [2, 0, 2, 1]),
|
||||
([2, 1, 1, 0], [2, 0, 1, 1]),
|
||||
([2, 1, 1, 2], [2, 2, 1, 1]),
|
||||
([2, 1, 2, 0], [2, 0, 2, 1]),
|
||||
([2, 1, 2, 1], [2, 2, 1, 1]),
|
||||
([2, 1, 2, 2], [2, 2, 2, 1]),
|
||||
([2, 2, 0, 1], [0, 2, 2, 1]),
|
||||
([2, 2, 1, 0], [2, 0, 1, 2]),
|
||||
],
|
||||
};
|
||||
let rules = rule_config.compile();
|
||||
|
|
Loading…
Reference in New Issue