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


C# EntityEventArgs类代码示例

本文整理汇总了C#中EntityEventArgs的典型用法代码示例。如果您正苦于以下问题:C# EntityEventArgs类的具体用法?C# EntityEventArgs怎么用?C# EntityEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EntityEventArgs类属于命名空间,在下文中一共展示了EntityEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: onCreate

 private static void onCreate(EntityEventArgs args)
 {
     var ent = args.Entity;
     if (!(ent is Projectile))
         return;
     //Projectile proj = ent as Projectile;
 }
开发者ID:detuks,项目名称:Ensage,代码行数:7,代码来源:HealthPrediction.cs

示例2: EntityRemoved

        private void EntityRemoved(object sender, EntityEventArgs entityEventArgs)
        {
            var gameObj = entityEventArgs.Entity;
            if (gameObj.GetComponent<Collider>() == null) return;

            var collider = gameObj.GetComponent<Collider>();
            colliders.Remove(collider);
            grid.RemoveCollider(collider);
        }
开发者ID:ChristianGreiner,项目名称:Avocado2D-old,代码行数:9,代码来源:CollisionManager.cs

示例3: OnAddEntity

        public void OnAddEntity(EntityEventArgs args)
        {
            var unit = args.Entity as Unit;

            if (unit == null || !unit.IsValid || !unit.IsControllable || unit.Team != heroTeam
                || (unit.IsIllusion && unit.ClassID != hero.ClassID) || unit.AttackCapability == AttackCapability.None
                || ignoredUnits.Contains(unit.ClassID) || unit.Equals(hero))
            {
                return;
            }

            var contrallable = new Controllable(unit);
            contrallable.OnCampChange += OnCampChange;
            controllableUnits.Add(contrallable);
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:15,代码来源:JungleStacker.cs

示例4: OnAddEntity

        public void OnAddEntity(EntityEventArgs args)
        {
            DelayAction.Add(
                1000f,
                () =>
                    {
                        var unit = args.Entity as Creep;

                        if (unit == null || !unit.IsValid || unit.Team == heroTeam)
                        {
                            return;
                        }

                        killableList.Add(new Classes.Creep(unit));
                    });
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:16,代码来源:LastHitMarker.cs

示例5: graphVisualization_OnEntityAdded

    private void graphVisualization_OnEntityAdded(object sender, EntityEventArgs e) {
      IConnection connection = e.Entity as IConnection;
      if (connection != null && !this.connectionInfoConnectionMapping.ContainsSecond(connection)) {
        IConnector connectorFrom = connection.From.AttachedTo;
        IConnector connectorTo = connection.To.AttachedTo;
        this.RemoveConnection(connection); //is added again by the model events

        if (connectorFrom != null && connectorTo != null) {
          IShape shapeFrom = (IShape)connectorFrom.Parent;
          IShape shapeTo = (IShape)connectorTo.Parent;
          IShapeInfo shapeInfoFrom = this.shapeInfoShapeMapping.GetBySecond(shapeFrom);
          IShapeInfo shapeInfoTo = this.shapeInfoShapeMapping.GetBySecond(shapeTo);
          string connectorFromName = connectorFrom.Name;
          string connectorToName = connectorTo.Name;

          if (shapeInfoFrom != shapeInfoTo) //avoid self references
            this.Content.AddConnectionInfo(new ConnectionInfo(shapeInfoFrom, connectorFromName, shapeInfoTo, connectorToName));
        }
      }
    }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:20,代码来源:GraphVisualizationInfoView.cs

示例6: ObjectManager_OnRemoveEntity

 private void ObjectManager_OnRemoveEntity(EntityEventArgs args)
 {
     predictions.OnRemoveEntity(args);
 }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:4,代码来源:Bootstrap.cs

示例7: shape_OnEntityChange

 private void shape_OnEntityChange(object sender, EntityEventArgs e) {
   IShape shape = e.Entity as IShape;
   IShapeInfo shapeInfo = this.shapeInfoShapeMapping.GetBySecond(shape);
   this.DeregisterShapeInfoEvents(shapeInfo);
   shapeInfo.UpdateShapeInfo(shape);
   this.RegisterShapeInfoEvents(shapeInfo);
   this.graphVisualization.Invalidate();
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:8,代码来源:GraphVisualizationInfoView.cs

示例8: ObjectMgr_OnAddEntity

 private static void ObjectMgr_OnAddEntity(EntityEventArgs args)
 {
     if (me == null || !Game.IsInGame)
     {
         return;
     }
     var ent = args.Entity as Unit;
     if (ent == null)
     {
         return;
     }
     //if (ent is Hero && !ent.IsIllusion && ent.Team == me.GetEnemyTeam())
     //{
     //    Console.WriteLine("Heroadded");
     //    enemyHeroes =
     //        ObjectMgr.GetEntities<Hero>()
     //            .Where(x => x != null && x.IsValid && x.Team == me.GetEnemyTeam() && !x.IsIllusion);
     //}
     if ((ent.ClassID == ClassID.CDOTA_NPC_TechiesMines) && !remoteMinesDb.ContainsKey(ent))
     {
         remoteMinesDb.Add(ent, remoteMinesDmg);
     }
 }
开发者ID:xzyxzy,项目名称:EnsageSharp-1,代码行数:23,代码来源:Techies.cs

示例9: ObjectMgr_OnRemoveEntity

        /// <summary>
        ///     The object manager on remove entity.
        /// </summary>
        /// <param name="args">
        ///     The args.
        /// </param>
        private static void ObjectMgr_OnRemoveEntity(EntityEventArgs args)
        {
            var tower = args.Entity as Building;
            if (tower == null)
            {
                return;
            }

            All.Remove(tower);
            if (tower.Team == Team.Dire)
            {
                Dire.Remove(tower);
            }
            else
            {
                Radiant.Remove(tower);
            }
        }
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:24,代码来源:Towers.cs

示例10: HandleTaskUpdated

 void HandleTaskUpdated(object sender, EntityEventArgs<Task> e)
 {
     ITaskListItemViewModel item = Items.FirstOrDefault(i => i.Id == e.Entity.Id);
     if (item != null)
     {
         Task task = tasksModel.Get(e.Entity.Id);
         item.Update(task);
     }
     ItemsView.Refresh();
 }
开发者ID:pjquirk,项目名称:timely,代码行数:10,代码来源:TaskListViewModel.cs

示例11: mDefaultPage_OnEntityAdded

 void mDefaultPage_OnEntityAdded(object sender, EntityEventArgs e)
 {
     //don't add it if it's already there or if it's a group (unless you want to deploy something special to emphasize a group shape).
     if (!mPaintables.Contains(e.Entity) && !(e.Entity is IGroup))
     {
         //set the new entity on top of the stack
         e.Entity.SceneIndex = mPaintables.Count;
         mPaintables.Add(e.Entity);
     }
     RaiseOnEntityAdded(e);
 }
开发者ID:Tom-Hoinacki,项目名称:OO-CASE-Tool,代码行数:11,代码来源:Model.cs

示例12: OnEntityRemoved

		protected virtual void OnEntityRemoved(EntityEventArgs e)
		{
			if (EntityRemoved != null)
				EntityRemoved(this, e);
			OnModified(EventArgs.Empty);
		}
开发者ID:BachelorEric,项目名称:ModelFirst,代码行数:6,代码来源:Model.cs

示例13: Model_OnEntityAdded

 void Model_OnEntityAdded(object sender, EntityEventArgs e)
 {
 }
开发者ID:Tom-Hoinacki,项目名称:OO-CASE-Tool,代码行数:3,代码来源:View.cs

示例14: RaiseOnSelect

 // ------------------------------------------------------------------
 /// <summary>
 /// Raises the OnSelect event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The 
 /// <see cref="T:Netron.Diagramming.Core.EntityEventArgs"/> instance 
 /// containing the event data.</param>
 // ------------------------------------------------------------------
 protected virtual void RaiseOnSelect(
     object sender,
     EntityEventArgs e) {
   if (OnEntitySelect != null) {
     OnEntitySelect(sender, e);
   }
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:16,代码来源:DiagramEntityBase.cs

示例15: graphVisualization_OnEntityRemoved

    private void graphVisualization_OnEntityRemoved(object sender, EntityEventArgs e) {
      IShape shape = e.Entity as IShape;
      if (shape != null && this.shapeInfoShapeMapping.ContainsSecond(shape)) {
        IShapeInfo shapeInfo = this.shapeInfoShapeMapping.GetBySecond(shape);
        this.Content.RemoveShapeInfo(shapeInfo);
      }

      IConnection connection = e.Entity as IConnection;
      if (connection != null && this.connectionInfoConnectionMapping.ContainsSecond(connection)) {
        IConnectionInfo connectionInfo = connectionInfoConnectionMapping.GetBySecond(connection);
        this.Content.RemoveConnectionInfo(connectionInfo);
      }
    }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:13,代码来源:GraphVisualizationInfoView.cs


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