本文整理汇总了C#中IActor类的典型用法代码示例。如果您正苦于以下问题:C# IActor类的具体用法?C# IActor怎么用?C# IActor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IActor类属于命名空间,在下文中一共展示了IActor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
m_Grid = GameObject.FindGameObjectWithTag("Grid").GetComponent<Grid>();
m_target = m_Grid.GetRandGrid();
m_actor = GetComponent<IActor>();
m_path = new List<GridNode>();
}
示例2: GetOutputPlugs
public IOutputPlug[] GetOutputPlugs(IActor actor, IInputPlug plug)
{
List<IOutputPlug> tempList = new List<IOutputPlug>();
foreach (IOutputPlug p in outputPlugs)
{
// Cases to add.
if (plug != null)
{
if (p.IsCompatible(plug))
tempList.Add(p);
}
else if (actor != null)
{
foreach (IInputPlug ip in actor.GetInputPlugs(null, null))
{
if (p.IsCompatible(ip))
{
tempList.Add(p);
break;
}
}
}
else
{
tempList.Add(p);
}
}
return tempList.ToArray();
}
示例3: EnterLocation
/// <summary>
/// Method that get called when a player want to enter a location also notifies to trip
/// recorder that player entered location
/// </summary>
/// <param name="actor"></param>
/// <returns></returns>
public virtual bool EnterLocation(IActor actor)
{
actor.CurrentLocation = this;
//Console.WriteLine("cell {0} entered by actor {1}", LocationName, actor.Name);
Recorder.EnterLocation(actor.Name, LocationName);
return true;
}
示例4: FindConfigFile
public static ConfigFileActor FindConfigFile(IActor actor)
{
if (actor.Environment != null)
{
IActor currentActor = actor.Environment.Owner;
if (currentActor != null)
{
while (!(currentActor is ConfigFileActor))
{
currentActor = currentActor.Environment.Owner;
if (currentActor == null)
break;
}
if (currentActor != null)
{
if (currentActor is ConfigFileActor)
{
return (ConfigFileActor)currentActor;
}
}
}
}
return null;
}
示例5: PWUnit
public PWUnit(IActor actor)
{
actor = Compatibility.Check<IPWRobot>(this, actor);
// actor.World.Clocks.AddTrigger(new TimerTrigger(UpdateSpeed, TriggerFrequency)); adding trigger example
rules = Compatibility.Check<IPWRules>(this, actor.Rules);
}
示例6: PositionComponent
public PositionComponent(IActor actor, IClientSyncComponent syncComponent, ILogger logger)
: base(actor)
{
_logger = logger;
_syncComponent = syncComponent;
_syncComponent.MessageReceived += new EventHandler<Core.Utility.EventArgs<Tuple<Core.Networking.IConnection, Core.Networking.Messages.ActorMessage>>>(_syncComponent_MessageReceived);
}
示例7: PositionComponent
public PositionComponent(IActor actor, IServerSyncComponent syncComponent)
: base(actor)
{
_syncComponent = syncComponent;
_syncComponent.ConnectionEnteringRelevantSet += new EventHandler<Core.Utility.EventArgs<Core.Networking.IConnection>>(_syncComponent_ConnectionEnteringRelevantSet);
sendPosition();
}
示例8: EnterLocation
/// <summary>
/// player can enter a location
/// </summary>
/// <param name="actor"></param>
/// <returns></returns>
public override bool EnterLocation(IActor actor)
{
if (base.EnterLocation(actor)) {
actor.CurrentLocation = this;
return true;
} else return false;
}
示例9: ExitLocation
public override void ExitLocation(IActor player)
{
DeadEnd(_location);
Exit();
_location.EnterLocation(player);
_update = new UpdateRequest(player, _location, _check);
}
示例10: Preprocess
public IEnumerable<ICommand> Preprocess(IActor actor, ICommand command)
{
if (!(command is IDWMCommand))
{
yield return command;
yield break;
}
var cmd = command as IDWMCommand;
if (cmd.DifWheelMovement == null)
{
yield return command;
yield break;
}
cmd.DifWheelMovement = new DifWheelMovement
{
LeftRotatingVelocity=cmd.DifWheelMovement.LeftRotatingVelocity*Multiplier,
RightRotatingVelocity = cmd.DifWheelMovement.RightRotatingVelocity*Multiplier,
Duration=cmd.DifWheelMovement.Duration,
};
yield return cmd as ICommand;
}
示例11: CreateModifier
public IModifier CreateModifier(IActor target, IActor source, IStat stat, int amount)
{
IModifier modifier = this.CreateModifier(target, source, amount);
modifier.SetAffectedStat(stat);
return modifier;
}
示例12: GetRegionFromPosition
public static Region GetRegionFromPosition(IActor actor)
{
Console.WriteLine(string.Format("posX {0} - posY {1}",actor.posX,actor.posY));
int indexX = GetIndex(actor.posX);
int indexY = GetIndex(actor.posY);
return Region.arrRegion[indexX, indexY];
}
示例13: Explore
private void Explore(IActor actor, ILocation location)
{
//If an exit location is found, print the path and continue to find another exit
if (location is ExitLocation)
{
if ((location as ExitLocation).ExitPreviouslyFound)
return;
(location as ExitLocation).ExitPreviouslyFound = true;
NumberOfExits++;
TripRecorder.Instance.PrintTrip();
terrain.PathToExit();
terrain.TerrainPrinter(terrain.StartLocation);
str= String.Format("{0} Number Of Exit(s) Found!", NumberOfExits);
Console.WriteLine(str);
Console.WriteLine("*****************************************************************");
return;
}
//When the location is dead end
if (location.ListOfNeighbors().Count == 0)
{
(location as MarkedLocation).MarkRed();
return;
}
//traverses to all the neigbors of a location
foreach (var neighbor in location.ListOfNeighbors())
{
location.MoveToNeighbor(actor, neighbor.Key);
Explore(actor, neighbor.Value);
}
//The location will be marked red when it backtracks
(location as MarkedLocation).MarkRed();
}
示例14: SimpleSyncComponent
public SimpleSyncComponent(IActor actor, IConnectionManager connectionManager)
{
_actor = actor;
_connectionManager = connectionManager;
_connectionManager.ConnectionInitialized += new EventHandler<EventArgs<IConnection>>(_connectionManager_ConnectionInitialized);
_connectionManager.ConnectionTerminated += new EventHandler<EventArgs<IConnection>>(_connectionManager_ConnectionTerminated);
}
示例15: interact
public void interact(IActor actor)
{
if (canInteract(actor)) {
ICommand command = new PickUpCommand(actor, item);
command.execute();
}
}