Actor.traits is implementation detail

This commit is contained in:
Bob
2010-08-14 15:19:30 +12:00
committed by alzeih
parent f6c6255f64
commit ae703d50b2
165 changed files with 586 additions and 561 deletions

View File

@@ -1,19 +1,19 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
using OpenRA.FileFormats;
using System.Linq;
using OpenRA.Traits;
using OpenRA.FileFormats;
namespace OpenRA.Mods.RA
{
public class CrateSpawnerInfo : TraitInfo<CrateSpawner>
@@ -62,14 +62,14 @@ namespace OpenRA.Mods.RA
if (!(inWater ? info.ValidWater : info.ValidGround).Contains(terrainType)) continue;
// Don't spawn on any actors
if (self.World.WorldActor.traits.Get<BuildingInfluence>().GetBuildingAt(p) != null) continue;
if (self.World.WorldActor.traits.Get<UnitInfluence>().GetUnitsAt(p).Any()) continue;
if (self.World.WorldActor.Trait<BuildingInfluence>().GetBuildingAt(p) != null) continue;
if (self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt(p).Any()) continue;
self.World.AddFrameEndTask(
w => crates.Add(w.CreateActor("crate", new TypeDictionary
{
new LocationInit( p ),
new OwnerInit( self.World.WorldActor.Owner ),
w => crates.Add(w.CreateActor("crate", new TypeDictionary
{
new LocationInit( p ),
new OwnerInit( self.World.WorldActor.Owner ),
})));
return;
}