• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# EntityEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: OnEntityStateChanged

 /// <summary>On entity added event triggered</summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">Event args.</param>
 void OnEntityStateChanged(object sender, EntityEventArgs e)
 {
     if (e.State == EntityState.Added)
         Entities.Add(e.Entity);
     else if (e.State == EntityState.Removed)
         Entities.Remove(e.Entity);
 }
开发者ID:brainster-one,项目名称:khrussk,代码行数:10,代码来源:TestContext.cs


示例17: OnAddEntity

        public void OnAddEntity(EntityEventArgs args)
        {
            if (!Menu.Hotkeys.EnabledEvader)
            {
                return;
            }

            var unit = args.Entity as Unit;

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

            if (Menu.Debug.LogUnits)
            {
                Debugger.WriteLine("====", Debugger.Type.Units);
                Debugger.WriteLine("unit name: " + unit.Name, Debugger.Type.Units);
                Debugger.WriteLine("unit id: " + unit.ClassID, Debugger.Type.Units);
                Debugger.WriteLine("vision: " + unit.DayVision, Debugger.Type.Units);
                if (unit.Owner != null && unit.Owner.IsValid)
                {
                    Debugger.WriteLine("owner: " + unit.Owner.Name, Debugger.Type.Units);
                }
                else
                {
                    Debugger.WriteLine("owner not valid", Debugger.Type.Units);
                }
            }

            if (unit.ClassID != ClassID.CDOTA_BaseNPC || unit.AttackCapability != AttackCapability.None
                || unit.Team == HeroTeam)
            {
                return;
            }

            var dayVision = unit.DayVision;

            if (Menu.Debug.LogInformation && dayVision > 0)
            {
                Debugger.Write("  = >   Unit (" + unit.Name + ") with vision: " + dayVision + " // ");
                var closestHero =
                    ObjectManager.GetEntitiesParallel<Hero>()
                        .Where(x => x.IsValid && x.IsAlive)
                        .OrderBy(x => x.Distance2D(unit))
                        .FirstOrDefault();
                Debugger.WriteLine(closestHero.GetName() + " (" + closestHero.Distance2D(unit) + ")", showType: false);
            }

            var abilityNames = AdditionalAbilityData.Vision.Where(x => x.Value == dayVision).Select(x => x.Key).ToList();

            if (!abilityNames.Any())
            {
                if (Menu.Debug.LogInformation && dayVision > 0)
                {
                    Debugger.WriteLine("  = >   Ability name not found");
                }
                return;
            }

            var abilities = abilityUpdater.EvadableAbilities.Where(x => abilityNames.Contains(x.Name)).ToList();

            if (abilities.Count != 1)
            {
                if (abilities.Count < 1)
                {
                    return;
                }

                Debugger.Write("=> Same vision for: ");
                foreach (var ability in abilities)
                {
                    Debugger.Write(ability.Name + " ", showType: false);
                }
                Debugger.WriteLine(showType: false);

                return;
            }

            var unitAbility = abilities.FirstOrDefault() as IUnit;
            if (unitAbility == null)
            {
                return;
            }

            Debugger.WriteLine("  = >   Ability name: " + unitAbility.Name);
            unitAbility.AddUnit(unit);
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:88,代码来源:Evader.cs


示例18: mModel_OnEntityRemoved

 void mModel_OnEntityRemoved(object sender, EntityEventArgs e)
 {
     RaiseOnEntityRemoved(e);
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:4,代码来源:ControllerBase.cs


示例19: ObjectMgr_OnRemoveEntity

 private static void ObjectMgr_OnRemoveEntity(EntityEventArgs args)
 {
     if (me == null || !Game.IsInGame)
     {
         return;
     }
     var ent = args.Entity as Unit;
     if (ent != null && (ent.ClassID == ClassID.CDOTA_NPC_TechiesMines) && remoteMinesDb.ContainsKey(ent))
     {
         remoteMinesDb.Remove(ent);
     }
 }
开发者ID:xzyxzy,项目名称:EnsageSharp-1,代码行数:12,代码来源:Techies.cs


示例20: Controller_OnEntityRemoved

 /// <summary>
 /// Handles the OnEntityRemoved event of the Controller control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:Netron.Diagramming.Core.EntityEventArgs"/> instance containing the event data.</param>
 void Controller_OnEntityRemoved(object sender, EntityEventArgs e)
 {
     RaiseOnEntityRemoved(e);
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:9,代码来源:DiagramControlBase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# EntityHandle类代码示例发布时间:2022-05-24
下一篇:
C# EntityEntry类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap