当前位置: 首页>>代码示例>>C#>>正文


C# IActor类代码示例

本文整理汇总了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>();
 }
开发者ID:OnionMoeCat,项目名称:AI-Assignments,代码行数:8,代码来源:PathfollowingController.cs

示例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();
        }
开发者ID:BackupTheBerlios,项目名称:proteus-svn,代码行数:31,代码来源:PlugCollection.cs

示例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;
 }
开发者ID:akrem1st,项目名称:Assignment2c-git,代码行数:13,代码来源:Location.cs

示例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;
        }
开发者ID:BackupTheBerlios,项目名称:proteus-svn,代码行数:28,代码来源:Actor.cs

示例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);
            
        }
开发者ID:mironov-alexey,项目名称:uCvarc,代码行数:7,代码来源:PWUnit.cs

示例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);
 }
开发者ID:AugustoAngeletti,项目名称:blockspaces,代码行数:7,代码来源:PositionComponent.cs

示例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();
 }
开发者ID:AugustoAngeletti,项目名称:blockspaces,代码行数:7,代码来源:PositionComponent.cs

示例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;
 }
开发者ID:akrem1st,项目名称:Assignment2d,代码行数:12,代码来源:WaterLocation.cs

示例9: ExitLocation

 public override void ExitLocation(IActor player)
 {
     DeadEnd(_location);
     Exit();
     _location.EnterLocation(player);
     _update = new UpdateRequest(player, _location, _check);
 }
开发者ID:dataartisan,项目名称:Project2C,代码行数:7,代码来源:ContainerLocation.cs

示例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;

		}
开发者ID:mironov-alexey,项目名称:uCvarc,代码行数:26,代码来源:DWMDistortionCommandFilter.cs

示例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;
        }
开发者ID:danec020,项目名称:MudEngine,代码行数:7,代码来源:ModifierFactory.cs

示例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];
 }
开发者ID:anhle128,项目名称:demo_photon_with_unity,代码行数:7,代码来源:Region.cs

示例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();
        }
开发者ID:akrem1st,项目名称:Assignment2c-git,代码行数:34,代码来源:TerrainAutoExploration.cs

示例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);
 }
开发者ID:AugustoAngeletti,项目名称:blockspaces,代码行数:7,代码来源:SimpleSyncComponent.cs

示例15: interact

 public void interact(IActor actor)
 {
     if (canInteract(actor)) {
         ICommand command = new PickUpCommand(actor, item);
         command.execute();
     }
 }
开发者ID:evilcandybag,项目名称:DwarfSplat,代码行数:7,代码来源:ItemOnGround.cs


注:本文中的IActor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。