Combine IMapGenerator interfaces.
This removes the need to instantiate a dummy trait instance and is more idiomatic.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
7ee79a0e64
commit
23b7b56c28
@@ -10,7 +10,6 @@
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Widgets;
|
||||
@@ -48,7 +47,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var markerToolPanel = widget.Get("MARKER_TOOL_PANEL");
|
||||
toolPanels.Add(MapTool.MarkerTiles, markerToolPanel);
|
||||
if (world.WorldActor.TraitsImplementing<IMapGenerator>().Any())
|
||||
if (world.Map.Rules.Actors[SystemActors.EditorWorld].HasTraitInfo<IMapGeneratorInfo>())
|
||||
{
|
||||
var mapGeneratorToolPanel = widget.GetOrNull("MAP_GENERATOR_TOOL_PANEL");
|
||||
if (mapGeneratorToolPanel != null)
|
||||
|
||||
Reference in New Issue
Block a user