From 41a3dae138b8a45ba8bf42621c2454a267d89290 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 12 Apr 2022 23:52:24 -0400 Subject: [PATCH] Objective cleanup --- core/src/mindustry/content/SectorPresets.java | 10 ++++------ core/src/mindustry/game/MapObjectives.java | 5 +++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/content/SectorPresets.java b/core/src/mindustry/content/SectorPresets.java index 9069e5f88d..3e0a9d8737 100644 --- a/core/src/mindustry/content/SectorPresets.java +++ b/core/src/mindustry/content/SectorPresets.java @@ -115,12 +115,10 @@ public class SectorPresets{ difficulty = 1; rules = r -> { - r.objectives.addAll(new ItemObjective(Items.beryllium, 20){{ - markers = new ObjectiveMarker[]{ - new TextMarker("Units can mine [accent]resources[] from walls.", 1984f, 2240f + 16f), - new ShapeMarker(1984f, 2240f), - }; - }}); + r.objectives.addAll(new ItemObjective(Items.beryllium, 20).withMarkers( + new TextMarker("Use the unit to mine [accent]resources[] from walls.", 1984f, 2240f + 16f), + new ShapeMarker(1984f, 2240f) + )); }; }}; diff --git a/core/src/mindustry/game/MapObjectives.java b/core/src/mindustry/game/MapObjectives.java index 8179547333..e152e3c03b 100644 --- a/core/src/mindustry/game/MapObjectives.java +++ b/core/src/mindustry/game/MapObjectives.java @@ -73,6 +73,11 @@ public class MapObjectives{ public static abstract class MapObjective{ public ObjectiveMarker[] markers = {}; + public MapObjective withMarkers(ObjectiveMarker... markers){ + this.markers = markers; + return this; + } + public boolean complete(){ return false; }