refactoring Widget
This commit is contained in:
@@ -166,12 +166,17 @@ namespace OpenRA.Widgets
|
||||
|
||||
throw new InvalidOperationException("Impossible");
|
||||
}
|
||||
|
||||
public abstract void DrawInner( World world );
|
||||
|
||||
public virtual void Draw(World world)
|
||||
public void Draw(World world)
|
||||
{
|
||||
if (IsVisible())
|
||||
{
|
||||
DrawInner( world );
|
||||
foreach (var child in Children)
|
||||
child.Draw(world);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Tick(World world)
|
||||
@@ -229,6 +234,8 @@ namespace OpenRA.Widgets
|
||||
|
||||
public ContainerWidget(Widget other) : base(other) { }
|
||||
|
||||
public override void DrawInner( World world ) { }
|
||||
|
||||
public override Widget Clone() { return new ContainerWidget(this); }
|
||||
}
|
||||
public interface IWidgetDelegate { }
|
||||
|
||||
Reference in New Issue
Block a user