mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-02 10:01:34 -04:00
Make creating args virtual in DrawCmd
This commit is contained in:
parent
4a2dc63947
commit
d63b498c31
@ -34,14 +34,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
protected const string BrushHelpLine = " %HFor help about brushes, type %T/Help Brush";
|
||||
|
||||
public override void Use(Player p, string message, CommandData data) {
|
||||
message = message.ToLower();
|
||||
string[] parts = message.SplitSpaces();
|
||||
|
||||
DrawArgs dArgs = new DrawArgs();
|
||||
dArgs.Message = message;
|
||||
dArgs.Player = p;
|
||||
dArgs.Mode = GetMode(parts);
|
||||
dArgs.Op = GetDrawOp(dArgs);
|
||||
DrawArgs dArgs = MakeArgs(p, message);
|
||||
if (dArgs.Op == null) return;
|
||||
|
||||
// Validate the brush syntax is correct
|
||||
@ -53,6 +46,18 @@ namespace MCGalaxy.Commands.Building {
|
||||
p.MakeSelection(MarksCount, "Selecting " + SelectionType + " for %S" + dArgs.Op.Name, dArgs, DoDraw);
|
||||
}
|
||||
|
||||
protected virtual DrawArgs MakeArgs(Player p, string message) {
|
||||
DrawArgs dArgs = new DrawArgs();
|
||||
message = message.ToLower();
|
||||
string[] parts = message.SplitSpaces();
|
||||
|
||||
dArgs.Message = message;
|
||||
dArgs.Player = p;
|
||||
dArgs.Mode = GetMode(parts);
|
||||
dArgs.Op = GetDrawOp(dArgs);
|
||||
return dArgs;
|
||||
}
|
||||
|
||||
protected virtual bool DoDraw(Player p, Vec3S32[] marks, object state, BlockID block) {
|
||||
DrawArgs dArgs = (DrawArgs)state;
|
||||
dArgs.Block = block;
|
||||
|
@ -180,11 +180,6 @@ namespace MCGalaxy {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Returns whether the given coordinates are insides the boundaries of this level. </summary>
|
||||
public bool InBound(ushort x, ushort y, ushort z) {
|
||||
return x >= 0 && y >= 0 && z >= 0 && x < Width && y < Height && z < Length;
|
||||
}
|
||||
|
||||
public void SaveSettings() { if (!IsMuseum) Config.SaveFor(MapName); }
|
||||
|
||||
// Returns true if ListCheck does not already have an check in the position.
|
||||
|
Loading…
x
Reference in New Issue
Block a user