From 0b3dddcc9e20ad574a02fc958624df3ee9087c48 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 1 Jul 2021 17:06:35 -0400 Subject: [PATCH] Minor reformatting --- core/src/mindustry/game/Rules.java | 32 +++++++++---------- .../ui/dialogs/CustomRulesDialog.java | 2 +- .../world/blocks/payloads/Payload.java | 1 + 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index b0dd8d3b4f..2fa767518d 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -114,22 +114,6 @@ public class Rules{ /** special tags for additional info. */ public StringMap tags = new StringMap(); - /** A team-specific ruleset. */ - public static class TeamRule{ - /** Whether to use building AI. */ - public boolean ai; - /** TODO Tier of blocks/designs that the AI uses for building. [0, 1] */ - public float aiTier = 1f; - /** Whether, when AI is enabled, ships should be spawned from the core. */ - public boolean aiCoreSpawn = true; - /** If true, blocks don't require power or resources. */ - public boolean cheat; - /** If true, resources are not consumed when building. */ - public boolean infiniteResources; - /** If true, this team has infinite unit ammo. */ - public boolean infiniteAmmo; - } - /** Copies this ruleset exactly. Not efficient at all, do not use often. */ public Rules copy(){ return JsonIO.copy(this); @@ -150,6 +134,22 @@ public class Rules{ } } + /** A team-specific ruleset. */ + public static class TeamRule{ + /** Whether to use building AI. */ + public boolean ai; + /** TODO Tier of blocks/designs that the AI uses for building. [0, 1] */ + public float aiTier = 1f; + /** Whether, when AI is enabled, ships should be spawned from the core. */ + public boolean aiCoreSpawn = true; + /** If true, blocks don't require power or resources. */ + public boolean cheat; + /** If true, resources are not consumed when building. */ + public boolean infiniteResources; + /** If true, this team has infinite unit ammo. */ + public boolean infiniteAmmo; + } + /** A simple map for storing TeamRules in an efficient way without hashing. */ public static class TeamRules implements JsonSerializable{ final TeamRule[] values = new TeamRule[Team.all.length]; diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index aa19947d54..7c77c47d75 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -212,7 +212,7 @@ public class CustomRulesDialog extends BaseDialog{ main.table(t -> { t.left(); t.add(text).left().padRight(5); - t.field((integer ? (int)prov.get() : prov.get()) + "", s -> cons.get(Strings.parseInt(s))) + t.field((integer ? prov.get() : prov.get()) + "", s -> cons.get(Strings.parseInt(s))) .padRight(100f) .valid(f -> Strings.parseInt(f) >= min && Strings.parseInt(f) <= max).width(120f).left().addInputDialog(); }).padTop(0); diff --git a/core/src/mindustry/world/blocks/payloads/Payload.java b/core/src/mindustry/world/blocks/payloads/Payload.java index cccb81c011..5cc05471b5 100644 --- a/core/src/mindustry/world/blocks/payloads/Payload.java +++ b/core/src/mindustry/world/blocks/payloads/Payload.java @@ -23,6 +23,7 @@ public interface Payload extends Position{ float size(); float x(); + float y(); /** @return whether this payload was dumped. */