From 350e1619e1cc89284e51dc1f77a6d3024fa96261 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 30 May 2018 15:28:31 +1000 Subject: [PATCH] Simplify /tree code somewhat --- MCGalaxy/Commands/building/CmdBezier.cs | 13 +-- MCGalaxy/Commands/building/CmdCopy.cs | 15 ++- MCGalaxy/Commands/building/CmdCopySlot.cs | 8 +- MCGalaxy/Commands/building/CmdDraw.cs | 16 +-- MCGalaxy/Commands/building/CmdFill.cs | 11 +- MCGalaxy/Commands/building/CmdHollow.cs | 2 +- MCGalaxy/Commands/building/CmdPaste.cs | 4 +- MCGalaxy/Commands/building/CmdRainbow.cs | 2 +- MCGalaxy/Commands/building/CmdSphere.cs | 4 +- MCGalaxy/Commands/building/CmdSpin.cs | 8 +- MCGalaxy/Commands/building/CmdTorus.cs | 4 +- MCGalaxy/Commands/building/CmdTree.cs | 106 ++++++------------ MCGalaxy/Commands/building/CmdTriangle.cs | 4 +- .../Drawing/BrushFactories/SimpleBrushes.cs | 2 +- MCGalaxy/Drawing/DrawOps/TreeDrawOp.cs | 7 +- MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs | 4 +- MCGalaxy/Player/Player.Fields.cs | 9 +- MCGalaxy/Player/Player.cs | 5 - 18 files changed, 87 insertions(+), 137 deletions(-) diff --git a/MCGalaxy/Commands/building/CmdBezier.cs b/MCGalaxy/Commands/building/CmdBezier.cs index a62c6397f..a26685abc 100644 --- a/MCGalaxy/Commands/building/CmdBezier.cs +++ b/MCGalaxy/Commands/building/CmdBezier.cs @@ -21,18 +21,15 @@ using MCGalaxy.Drawing.Ops; namespace MCGalaxy.Commands.Building { public sealed class CmdBezier : DrawCmd { public override string name { get { return "Bezier"; } } - - protected override int MarksCount { get { return 3; } } - protected override string SelectionType { get { return "points"; } } - protected override string PlaceMessage { get { return "Place or break two blocks to determine the endpoints, then another for the control point"; } } - public override CommandAlias[] Aliases { get { return new CommandAlias[] { new CommandAlias("Curve") }; } } - protected override DrawOp GetDrawOp(DrawArgs dArgs) { - return new BezierDrawOp(); - } + protected override int MarksCount { get { return 3; } } + protected override string SelectionType { get { return "points"; } } + protected override string PlaceMessage { get { return "Place or break two blocks to determine the endpoints, then another for the control point"; } } + + protected override DrawOp GetDrawOp(DrawArgs dArgs) { return new BezierDrawOp(); } public override void Help(Player p) { Player.Message(p, "%T/Bezier "); diff --git a/MCGalaxy/Commands/building/CmdCopy.cs b/MCGalaxy/Commands/building/CmdCopy.cs index 7949574f2..41f757c3d 100644 --- a/MCGalaxy/Commands/building/CmdCopy.cs +++ b/MCGalaxy/Commands/building/CmdCopy.cs @@ -97,7 +97,7 @@ namespace MCGalaxy.Commands.Building { void DoCopyMark(Player p, Vec3S32[] m, int i, object state, BlockID block) { if (i == 2) { - CopyState copy = p.CopySlots[p.CurrentCopySlot]; + CopyState copy = p.CurrentCopy; copy.Offset.X = copy.OriginX - m[i].X; copy.Offset.Y = copy.OriginY - m[i].Y; copy.Offset.Z = copy.OriginZ - m[i].Z; @@ -139,7 +139,8 @@ namespace MCGalaxy.Commands.Building { } cState.CopySource = "level " + p.level.name; - p.SetCurrentCopy(cState); + p.CurrentCopy = cState; + if (cArgs.cut) { DrawOp op = new CuboidDrawOp(); op.Flags = BlockDBFlags.Cut; @@ -172,11 +173,16 @@ namespace MCGalaxy.Commands.Building { return; } + CopyState cState = p.CurrentCopy; + if (cState == null) { + Player.Message(p, "You haven't copied anything yet"); return; + } + string path = "extra/savecopy/" + p.name + "/" + file + ".cpb"; using (FileStream fs = File.Create(path)) using(GZipStream gs = new GZipStream(fs, CompressionMode.Compress)) { - p.CopySlots[p.CurrentCopySlot].SaveTo(gs); + cState.SaveTo(gs); } Player.Message(p, "Saved copy as " + file); } @@ -195,8 +201,9 @@ namespace MCGalaxy.Commands.Building { } else { state.LoadFromOld(gs, fs); } + state.CopySource = "file " + file; - p.SetCurrentCopy(state); + p.CurrentCopy = state; } Player.Message(p, "Loaded copy from " + file); } diff --git a/MCGalaxy/Commands/building/CmdCopySlot.cs b/MCGalaxy/Commands/building/CmdCopySlot.cs index 557168ca3..3012df538 100644 --- a/MCGalaxy/Commands/building/CmdCopySlot.cs +++ b/MCGalaxy/Commands/building/CmdCopySlot.cs @@ -40,11 +40,11 @@ namespace MCGalaxy.Commands.Building { int i = 0; if (!CommandParser.GetInt(p, message, "Slot number", ref i, 1, p.group.CopySlots)) return; - i--; p.CurrentCopySlot = i; - if (i >= p.CopySlots.Count || p.CopySlots[i] == null) { - Player.Message(p, "Selected copy slot {0} (unused)", i + 1); + p.CurrentCopySlot = i - 1; + if (p.CurrentCopy == null) { + Player.Message(p, "Selected copy slot {0} (unused)", i); } else { - Player.Message(p, "Selected copy slot {0}: {1}", i + 1, p.CopySlots[i].Summary); + Player.Message(p, "Selected copy slot {0}: {1}", i, p.CurrentCopy.Summary); } } } diff --git a/MCGalaxy/Commands/building/CmdDraw.cs b/MCGalaxy/Commands/building/CmdDraw.cs index f023b612b..39260f0fa 100644 --- a/MCGalaxy/Commands/building/CmdDraw.cs +++ b/MCGalaxy/Commands/building/CmdDraw.cs @@ -63,21 +63,21 @@ namespace MCGalaxy.Commands.Building { AdvDrawMeta meta = new AdvDrawMeta(); bool success = false; - string[] parts = dArgs.Message.SplitSpaces(); + string[] args = dArgs.Message.SplitSpaces(); Player p = dArgs.Player; if (op.UsesHeight) { - if (parts.Length < 3) { - Player.Message(p, "You need to provide the radius and the height for the {0}.", parts[0]); + if (args.Length < 3) { + Player.Message(p, "You need to provide the radius and the height for the {0}.", args[0]); } else { - success = CommandParser.GetInt(p, parts[1], "radius", ref meta.radius, 0, 2000) - && CommandParser.GetInt(p, parts[2], "height", ref meta.height, 0, 2000); + success = CommandParser.GetInt(p, args[1], "radius", ref meta.radius, 0, 2000) + && CommandParser.GetInt(p, args[2], "height", ref meta.height, 0, 2000); } } else { - if (parts.Length < 2) { - Player.Message(p, "You need to provide the radius for the {0}.", parts[0]); + if (args.Length < 2) { + Player.Message(p, "You need to provide the radius for the {0}.", args[0]); } else { - success = CommandParser.GetInt(p, parts[1], "radius", ref meta.radius, 0, 2000); + success = CommandParser.GetInt(p, args[1], "radius", ref meta.radius, 0, 2000); } } diff --git a/MCGalaxy/Commands/building/CmdFill.cs b/MCGalaxy/Commands/building/CmdFill.cs index 12e27b007..5eb2d11c1 100644 --- a/MCGalaxy/Commands/building/CmdFill.cs +++ b/MCGalaxy/Commands/building/CmdFill.cs @@ -36,14 +36,11 @@ namespace MCGalaxy.Commands.Building { protected override string PlaceMessage { get { return "Place or break a block to mark the area you wish to fill."; } } protected override DrawMode GetMode(string[] parts) { - if (parts[parts.Length - 1].CaselessEq("confirm")) { - string prev = parts.Length >= 2 ? parts[parts.Length - 2] : ""; - return ParseFillMode(prev); + string msg = parts[parts.Length - 1]; + if (msg.CaselessEq("confirm")) { + msg = parts.Length >= 2 ? parts[parts.Length - 2] : ""; } - return ParseFillMode(parts[parts.Length - 1]); - } - - DrawMode ParseFillMode(string msg) { + if (msg == "normal") return DrawMode.solid; if (msg == "up") return DrawMode.up; if (msg == "down") return DrawMode.down; diff --git a/MCGalaxy/Commands/building/CmdHollow.cs b/MCGalaxy/Commands/building/CmdHollow.cs index d1fddd4d0..a720315e5 100644 --- a/MCGalaxy/Commands/building/CmdHollow.cs +++ b/MCGalaxy/Commands/building/CmdHollow.cs @@ -34,7 +34,7 @@ namespace MCGalaxy.Commands.Building { return op; } - protected override void GetBrush(DrawArgs dArgs) { dArgs.BrushName = "normal"; } + protected override void GetBrush(DrawArgs dArgs) { dArgs.BrushName = "Normal"; } public override void Help(Player p) { Player.Message(p, "%T/Hollow"); diff --git a/MCGalaxy/Commands/building/CmdPaste.cs b/MCGalaxy/Commands/building/CmdPaste.cs index ed7fc1d01..590fd92da 100644 --- a/MCGalaxy/Commands/building/CmdPaste.cs +++ b/MCGalaxy/Commands/building/CmdPaste.cs @@ -35,7 +35,7 @@ namespace MCGalaxy.Commands.Building { } public override void Use(Player p, string message) { - if (p.CurrentCopySlot >= p.CopySlots.Count || p.CopySlots[p.CurrentCopySlot] == null) { + if (p.CurrentCopy == null) { Player.Message(p, "You haven't copied anything yet"); return; } @@ -48,7 +48,7 @@ namespace MCGalaxy.Commands.Building { } bool DoPaste(Player p, Vec3S32[] m, object state, BlockID block) { - CopyState cState = p.CopySlots[p.CurrentCopySlot]; + CopyState cState = p.CurrentCopy; m[0] += cState.Offset; PasteDrawOp op = new PasteDrawOp(); diff --git a/MCGalaxy/Commands/building/CmdRainbow.cs b/MCGalaxy/Commands/building/CmdRainbow.cs index 3d1c6558c..d359f6cf7 100644 --- a/MCGalaxy/Commands/building/CmdRainbow.cs +++ b/MCGalaxy/Commands/building/CmdRainbow.cs @@ -24,7 +24,7 @@ namespace MCGalaxy.Commands.Building { public override string name { get { return "Rainbow"; } } public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } } - protected override void GetBrush(DrawArgs dArgs) { dArgs.BrushName = "normal"; } + protected override void GetBrush(DrawArgs dArgs) { dArgs.BrushName = "Normal"; } protected override DrawOp GetDrawOp(DrawArgs dArgs) { string args = dArgs.Message; diff --git a/MCGalaxy/Commands/building/CmdSphere.cs b/MCGalaxy/Commands/building/CmdSphere.cs index 0a4708e9a..19e5e0058 100644 --- a/MCGalaxy/Commands/building/CmdSphere.cs +++ b/MCGalaxy/Commands/building/CmdSphere.cs @@ -30,9 +30,7 @@ namespace MCGalaxy.Commands.Building { new CommandAlias("sph", null, "hollow"), new CommandAlias("Circle", null, "circle" ), new CommandAlias("CircleH", null, "hollowcircle") }; } } - protected override string PlaceMessage { - get { return "Place a block for the centre, then another for the radius."; } - } + protected override string PlaceMessage { get { return "Place a block for the centre, then another for the radius."; } } protected override DrawMode GetMode(string[] parts) { string msg = parts[parts.Length - 1]; diff --git a/MCGalaxy/Commands/building/CmdSpin.cs b/MCGalaxy/Commands/building/CmdSpin.cs index 324954897..103c34d4e 100644 --- a/MCGalaxy/Commands/building/CmdSpin.cs +++ b/MCGalaxy/Commands/building/CmdSpin.cs @@ -31,11 +31,11 @@ namespace MCGalaxy.Commands.Building { public override void Use(Player p, string message) { if (message.Length == 0) message = "y"; - if (p.CurrentCopySlot >= p.CopySlots.Count || p.CopySlots[p.CurrentCopySlot] == null) { + if (p.CurrentCopy == null) { Player.Message(p, "You haven't copied anything yet"); return; } - CopyState cState = p.CopySlots[p.CurrentCopySlot]; + CopyState cState = p.CurrentCopy; string opt = message.ToLower(); BlockDefinition[] defs = p.level.CustomBlockDefs; @@ -67,8 +67,8 @@ namespace MCGalaxy.Commands.Building { } newState.CopySource = cState.CopySource; - newState.CopyTime = cState.CopyTime; - p.SetCurrentCopy(newState); + newState.CopyTime = cState.CopyTime; + p.CurrentCopy = newState; Player.Message(p, "Rotated copy {0} degrees around the {1} axis", angle, axis); } } diff --git a/MCGalaxy/Commands/building/CmdTorus.cs b/MCGalaxy/Commands/building/CmdTorus.cs index 0fdf19cbe..b7f485574 100644 --- a/MCGalaxy/Commands/building/CmdTorus.cs +++ b/MCGalaxy/Commands/building/CmdTorus.cs @@ -27,9 +27,7 @@ namespace MCGalaxy.Commands.Building { public override CommandAlias[] Aliases { get { return new[] { new CommandAlias("Donut"), new CommandAlias("Bagel") }; } } - protected override string PlaceMessage { - get { return "Place a block for the centre, then another for the radius."; } - } + protected override string PlaceMessage { get { return "Place a block for the centre, then another for the radius."; } } protected override void GetMarks(DrawArgs dArgs, ref Vec3S32[] m) { int dx = m[0].X - m[1].X, dy = m[0].Y - m[1].Y, dz = m[0].Z - m[1].Z; diff --git a/MCGalaxy/Commands/building/CmdTree.cs b/MCGalaxy/Commands/building/CmdTree.cs index e251c9dee..a4914cf5f 100644 --- a/MCGalaxy/Commands/building/CmdTree.cs +++ b/MCGalaxy/Commands/building/CmdTree.cs @@ -16,98 +16,56 @@ permissions and limitations under the Licenses. */ using System; -using MCGalaxy.Drawing.Brushes; using MCGalaxy.Drawing.Ops; using MCGalaxy.Generator.Foliage; -using MCGalaxy.Maths; -using BlockID = System.UInt16; namespace MCGalaxy.Commands.Building { - public sealed class CmdTree : Command { + public sealed class CmdTree : DrawCmd { public override string name { get { return "Tree"; } } public override string type { get { return CommandTypes.Building; } } - public override bool museumUsable { get { return false; } } - public override LevelPermission defaultRank { get { return LevelPermission.Builder; } } - public override bool SuperUseable { get { return false; } } - public override void Use(Player p, string message) { - string[] parts = message.SplitSpaces(3); + protected override int MarksCount { get { return 1; } } + protected override string SelectionType { get { return "location"; } } + protected override string PlaceMessage { get { return "Select where you wish your tree to grow"; } } + + protected override DrawOp GetDrawOp(DrawArgs dArgs) { + string[] args = dArgs.Message.SplitSpaces(3); + Tree tree = Tree.Find(args[0]); + if (tree == null) tree = new NormalTree(); - DrawArgs dArgs = new DrawArgs(); - dArgs.size = -1; - - Tree tree = Tree.Find(parts[0]); - if (tree == null) { - dArgs.brushMsg = message; - tree = new NormalTree(); - } - dArgs.tree = tree; - - int size; - if (parts.Length > 1 && int.TryParse(parts[1], out size)) { - if (size < tree.MinSize) { - Player.Message(p, "Value must be {0} or above for {1} trees.", tree.MinSize, parts[0]); return; - } - if (size > tree.MaxSize) { - Player.Message(p, "Value must be {0} or below for {1} trees.", tree.MaxSize, parts[0]); return; - } - - dArgs.size = size; - dArgs.brushMsg = message.Splice(2, 0); // type value/height brush + int size; + if (args.Length > 1 && int.TryParse(args[1], out size)) { + Player p = dArgs.Player; + string opt = args[0] + " tree size"; + if (!CommandParser.GetInt(p, args[1], opt, ref size, tree.MinSize, tree.MaxSize)) return null; } else { - dArgs.brushMsg = message.Splice(1, 0); // type brush + size = -1; } - if (!CheckBrush(p, dArgs.brushMsg)) return; - Player.Message(p, "Select where you wish your tree to grow"); - p.MakeSelection(1, "Selecting location for %STree", dArgs, DoTree); - } - - static bool CheckBrush(Player p, string brushMsg) { - if (brushMsg.Length == 0) return true; - - if (!p.group.CanExecute("Brush")) { - Player.Message(p, "You cannot use %T/Brush%S, so therefore cannot use %T/Tree%S with a brush."); return false; - } - return ParseBrush(brushMsg, p, Block.Air) != null; - } - - bool DoTree(Player p, Vec3S32[] marks, object state, BlockID block) { - DrawArgs dArgs = (DrawArgs)state; TreeDrawOp op = new TreeDrawOp(); - op.Tree = dArgs.tree; - op.Size = dArgs.size; - - Brush brush = null; - if (dArgs.brushMsg.Length > 0) brush = ParseBrush(dArgs.brushMsg, p, block); - DrawOpPerformer.Do(op, brush, p, marks); - return true; + op.Tree = tree; op.Size = size; + return op; } - - static Brush ParseBrush(string raw, Player p, BlockID block) { - string[] parts = raw.SplitSpaces(2); - BrushFactory brush = BrushFactory.Find(parts[0]); - if (brush == null) { - Player.Message(p, "No brush found with name \"{0}\".", parts[0]); - Player.Message(p, "Available brushes: " + BrushFactory.Available); - return null; + protected override void GetBrush(DrawArgs dArgs) { + TreeDrawOp op = (TreeDrawOp)dArgs.Op; + if (op.Size != -1) { + dArgs.BrushArgs = dArgs.Message.Splice(2, 0); // type, value/height, brush args + } else { + dArgs.BrushArgs = dArgs.Message.Splice(1, 0); // type, brush args + } + + // use leaf blocks by default + if (dArgs.BrushName.CaselessEq("Normal") && dArgs.BrushArgs.Length == 0) { + dArgs.BrushArgs = Block.Leaves.ToString(); } - - string brushArgs = parts.Length >= 2 ? parts[1].ToLower() : ""; - BrushArgs args = new BrushArgs(p, brushArgs, block); - return brush.Construct(args); } - - class DrawArgs { public Tree tree; public string brushMsg; public int size; } public override void Help(Player p) { - Player.Message(p, "%T/Tree [type] %H- Draws a tree."); - Player.Message(p, "%T/Tree [type] [size] %H- Draws a tree of given size."); - Player.Message(p, "%T/Tree [type] [brush name] "); - Player.Message(p, "%T/Tree [type] [size] [brush name] "); + Player.Message(p, "%T/Tree [type] %H- Draws a tree."); + Player.Message(p, "%T/Tree [type] [size/height] "); Player.Message(p, "%H Types: &f{0}", Tree.TreeTypes.Join(t => t.Key)); - Player.Message(p, "%H For help about brushes, type %T/Help Brush%H."); + Player.Message(p, BrushHelpLine); } } -} +} \ No newline at end of file diff --git a/MCGalaxy/Commands/building/CmdTriangle.cs b/MCGalaxy/Commands/building/CmdTriangle.cs index 3d4b90732..24e1181e7 100644 --- a/MCGalaxy/Commands/building/CmdTriangle.cs +++ b/MCGalaxy/Commands/building/CmdTriangle.cs @@ -26,9 +26,7 @@ namespace MCGalaxy.Commands.Building { protected override int MarksCount { get { return 3; } } protected override string PlaceMessage { get { return "Place three blocks to determine the edges."; } } - protected override DrawOp GetDrawOp(DrawArgs dArgs) { - return new TriangleDrawOp(); - } + protected override DrawOp GetDrawOp(DrawArgs dArgs) { return new TriangleDrawOp(); } public override void Help(Player p) { Player.Message(p, "%T/Triangle "); diff --git a/MCGalaxy/Drawing/BrushFactories/SimpleBrushes.cs b/MCGalaxy/Drawing/BrushFactories/SimpleBrushes.cs index ae2a3e0fe..2d18b2e23 100644 --- a/MCGalaxy/Drawing/BrushFactories/SimpleBrushes.cs +++ b/MCGalaxy/Drawing/BrushFactories/SimpleBrushes.cs @@ -100,7 +100,7 @@ namespace MCGalaxy.Drawing.Brushes { }; public override Brush Construct(BrushArgs args) { - CopyState cState = args.Player.CopySlots[args.Player.CurrentCopySlot]; + CopyState cState = args.Player.CurrentCopy; if (cState == null) { args.Player.SendMessage("You haven't copied anything yet."); return null; diff --git a/MCGalaxy/Drawing/DrawOps/TreeDrawOp.cs b/MCGalaxy/Drawing/DrawOps/TreeDrawOp.cs index 6581273fb..38e0c4db3 100644 --- a/MCGalaxy/Drawing/DrawOps/TreeDrawOp.cs +++ b/MCGalaxy/Drawing/DrawOps/TreeDrawOp.cs @@ -35,15 +35,12 @@ namespace MCGalaxy.Drawing.Ops { public override string Name { get { return "Tree"; } } public Random random = new Random(); - public Tree Tree; - static Brush defBrush = new SolidBrush(Block.Leaves); - + public Tree Tree; public int Size = -1; public override long BlocksAffected(Level lvl, Vec3S32[] marks) { return Tree.EstimateBlocksAffected(); } public override void Perform(Vec3S32[] marks, Brush brush, DrawOpOutput output) { - if (brush == null) brush = defBrush; Vec3U16 P = Clamp(marks[0]); Level lvl = Level; @@ -54,7 +51,7 @@ namespace MCGalaxy.Drawing.Ops { Tree.Generate(P.X, P.Y, P.Z, (xT, yT, zT, bT) => { if (bT != Block.Leaves) { - output(Place(xT, yT, zT, (ushort)bT)); + output(Place(xT, yT, zT, bT)); } else if (lvl.IsAirAt(xT, yT, zT)) { leaves.Add(new Vec3U16(xT, yT, zT)); } diff --git a/MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs b/MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs index 1a14dbc7f..8b49826a2 100644 --- a/MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs +++ b/MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs @@ -57,9 +57,7 @@ namespace MCGalaxy.Drawing.Ops { } pos = p1; - foreach (char c in Text) { - DrawLetter(Player, c, brush, output); - } + foreach (char c in Text) { DrawLetter(Player, c, brush, output); } } void DrawLetter(Player p, char c, Brush brush, DrawOpOutput output) { diff --git a/MCGalaxy/Player/Player.Fields.cs b/MCGalaxy/Player/Player.Fields.cs index a90450d07..85bb1686f 100644 --- a/MCGalaxy/Player/Player.Fields.cs +++ b/MCGalaxy/Player/Player.Fields.cs @@ -48,7 +48,7 @@ namespace MCGalaxy { public bool IsAfk, AutoAfk; public bool cmdTimer; public bool UsingWom; - public string BrushName = "normal", DefaultBrushArgs = ""; + public string BrushName = "Normal", DefaultBrushArgs = ""; public Transform Transform = NoTransform.Instance; public string afkMessage; public bool disconnected, ClickToMark = true; @@ -160,6 +160,13 @@ namespace MCGalaxy { public List CopySlots = new List(); public int CurrentCopySlot; + public CopyState CurrentCopy { + get { return CurrentCopySlot >= CopySlots.Count ? null : CopySlots[CurrentCopySlot]; } + set { + while (CurrentCopySlot >= CopySlots.Count) { CopySlots.Add(null); } + CopySlots[CurrentCopySlot] = value; + } + } // BlockDefinitions internal int gbStep = 0, lbStep = 0; diff --git a/MCGalaxy/Player/Player.cs b/MCGalaxy/Player/Player.cs index d4970c2a4..14197d3cf 100644 --- a/MCGalaxy/Player/Player.cs +++ b/MCGalaxy/Player/Player.cs @@ -334,11 +334,6 @@ namespace MCGalaxy { } return true; } - - public void SetCurrentCopy(CopyState state) { - while (CurrentCopySlot >= CopySlots.Count) { CopySlots.Add(null); } - CopySlots[CurrentCopySlot] = state; - } #endregion