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

C# BaseEntity类代码示例

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

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



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

示例1: AppendComment

 /// <summary>
 ///   Appends the comment.
 /// </summary>
 /// <param name = "entity">The entity.</param>
 /// <param name = "node">The node.</param>
 /// <param name = "comments">The comments.</param>
 protected static void AppendComment(BaseEntity entity, IEnumerable<Comment> comments)
 {
     foreach (Comment comment in comments) {
         String c = comment.CommentText.Trim ();
         if (CommentHelper.IsSummary (c)) {
             continue;
         }
         if (CommentHelper.IsAvailability (c)) {
             String str = c;
             foreach (String s in new[] {"<para>", "</para>", "&lt;para&gt;", "&lt;/para&gt;"}) {
                 str = str.Replace (s, String.Empty);
             }
             entity.MinAvailability = CommentHelper.ExtractAvailability (str.Trim ());
         } else if (CommentHelper.IsParameter (c) || CommentHelper.IsReturn (c) || CommentHelper.IsSignature (c)) {
             // Do nothing
         } else if (CommentHelper.IsParagraph (c)) {
             String str = c;
             foreach (String s in new[] {"<para>", "</para>", "&lt;para&gt;", "&lt;/para&gt;"}) {
                 str = str.Replace (s, String.Empty);
             }
             entity.Summary.Add (str.Trim ());
         } else if (CommentHelper.IsRemarks (c)) {
             String str = c;
             foreach (String s in new[] {"<remarks>", "</remarks>", "&lt;remarks&gt;", "&lt;/remarks&gt;"}) {
                 str = str.Replace (s, String.Empty);
             }
             entity.Summary.Add (str.Trim ());
         } else {
             entity.Summary.Add (c);
         }
     }
 }
开发者ID:Monobjc,项目名称:monobjc-tools,代码行数:38,代码来源:CodeDomBaseParser.cs


示例2: createShip

        public static IEntity createShip(EntitiesManager manager)
        {
            IEntity ship = new BaseEntity(manager);
            Vector2 Pos = new Vector2();
            Pos.X = manager.game.GraphicsDevice.Adapter.CurrentDisplayMode.Height / 8;
            Pos.Y = manager.game.GraphicsDevice.Adapter.CurrentDisplayMode.Width / 8;

            // for controlling behaviour
            ship.addAttribute("position", Pos);
            ship.addAttribute("velocity", new Vector2());
            ship.addAttribute("weight", 0.0076f);
            ship.addAttribute("direction", 0.0f);
            ship.addAttribute("scale", 1f);

            //for drawing
            Texture2D texture = manager.game.Content.Load<Texture2D>("ship");
            ship.addAttribute("texture", texture);

            //behaviours
            ship.addBehaviour(GameLoopPhase.Update, new GameControllingBehavior());
            ship.addBehaviour(GameLoopPhase.Update, new TemporaryGravityBehaviour());
            ship.addBehaviour(GameLoopPhase.Draw, new DrawTexture2DBehaviour());

            return ship;
        }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:25,代码来源:EntityFactory.cs


示例3: getAmmo

 public static int getAmmo(BaseEntity pro)
 {
     var pro1 = pro as BaseProjectile;
     if (pro1 == null)
         return 0;
     return pro1.primaryMagazine.contents;
 }
开发者ID:stuffedmotion,项目名称:plugins,代码行数:7,代码来源:EventDead.cs


示例4: CommitLinks

 public override void CommitLinks(BaseEntity entity)
 {
     if (EnableCommitLinks)
         base.CommitLinks (entity);
     else
         Console.WriteLine ("Bypassed DataLinker.CommitLinks for unit testing purposes.");
 }
开发者ID:CompulsiveCoder,项目名称:gitdb-cs,代码行数:7,代码来源:MockDataLinker.cs


示例5: ItemRepairEvent

 public ItemRepairEvent(RepairBench repairBench, BaseEntity.RPCMessage msg)
 {
     _repairBench = repairBench;
     _player = Server.GetPlayer(msg.player);
     _item = new InvItem(repairBench.inventory.GetSlot(0));
     _msg = msg;
 }
开发者ID:Viproz,项目名称:Pluton,代码行数:7,代码来源:ItemRepairEvent.cs


示例6: createGameExit

        public static IEntity createGameExit(EntitiesManager manager)
        {
            IEntity exit = new BaseEntity(manager);
            exit.addBehaviour(GameLoopPhase.Update, new ExitGameBehaviour());

            return exit;
        }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:7,代码来源:EntityFactory.cs


示例7: ItemPickupEvent

 public ItemPickupEvent(CollectibleEntity ce, BaseEntity.RPCMessage msg, Item i)
 {
     _entity = ce;
     _msg = msg;
     _player = Server.GetPlayer(msg.player);
     _item = new InvItem(i);
 }
开发者ID:Notulp,项目名称:Pluton,代码行数:7,代码来源:ItemPickupEvent.cs


示例8: SaveLinkedEntities

 public override void SaveLinkedEntities(BaseEntity entity)
 {
     if (EnableSaveLinkedEntities)
         base.SaveLinkedEntities (entity);
     else
         Console.WriteLine ("Bypassed DataLinker.SaveLinkedEntities for unit testing purposes.");
 }
开发者ID:CompulsiveCoder,项目名称:gitdb-cs,代码行数:7,代码来源:MockDataLinker.cs


示例9: JumpToNextEnemy

        private void JumpToNextEnemy(BaseEntity enemy)
        {
            List<BaseEntity> enemies = OGE.CurrentWorld.GetCollisionEntitiesType(Collision.CollisionType.Enemy);
            List<BaseEntity> bosses = OGE.CurrentWorld.GetCollisionEntitiesType(Collision.CollisionType.Boss);
            enemies.AddRange(bosses);
            BaseEntity nextEnemy = null;

            foreach (BaseEntity temp in enemies)
            {
                float enemyAngle = OGE.GetAngle(Position, temp.Position);
                float diffAngle = Math.Abs(direction - enemyAngle) % 360;

                if (temp == enemy)
                {
                    continue;
                }

                if (nextEnemy == null)
                {
                    nextEnemy = temp;
                }
                else if (OGE.GetDistance(Position, temp.Position) < OGE.GetDistance(Position, nextEnemy.Position))
                {
                    nextEnemy = temp;
                }
            }

            if (nextEnemy != null)
            {
                direction = OGE.GetAngle(Position, nextEnemy.Position);
            }
        }
开发者ID:amidos2006,项目名称:CleanEmUp,代码行数:32,代码来源:XenaBullet.cs


示例10: FindAndFixDifferences

        public virtual void FindAndFixDifferences(BaseEntity previousEntity, BaseEntity updatedEntity, PropertyInfo property)
        {
            if (Settings.IsVerbose)
                Console.WriteLine ("      Finding and fixing all differences between previous and updated '" + updatedEntity.GetType().Name + "' entity on '" + property.Name + "' property.");

            var previousLinks = new BaseEntity[]{ };

            if (previousEntity != null)
                previousLinks = Linker.GetLinkedEntities (previousEntity, property);

            var updatedLinks = Linker.GetLinkedEntities (updatedEntity, property);

            var linksToAdd = IdentifyEntityLinksToAdd (previousLinks, updatedLinks);

            var linksToRemove = IdentifyEntityLinksToRemove (previousLinks, updatedLinks);

            if (Settings.IsVerbose) {
                Console.WriteLine ("      Links to add: " + linksToAdd.Length);
                Console.WriteLine ("      Links to remove: " + linksToRemove.Length);
            }

            if (linksToAdd.Length > 0)
                CommitNewReverseLinks (updatedEntity, property, linksToAdd);

            if (linksToRemove.Length > 0)
                RemoveOldReverseLinks (updatedEntity, property, linksToRemove);
        }
开发者ID:CompulsiveCoder,项目名称:gitdb-cs,代码行数:27,代码来源:DataLinker.cs


示例11: RocketShootEvent

 public RocketShootEvent(BaseLauncher baseLauncher, BaseEntity.RPCMessage msg, BaseEntity baseEntity)
 {
     _entity = new Entity(baseEntity);
     _player = Server.GetPlayer(msg.player);
     _msg = msg;
     _launch = baseLauncher;
 }
开发者ID:Viproz,项目名称:Pluton,代码行数:7,代码来源:RocketShootEvent.cs


示例12: TestEntityToXml

 public void TestEntityToXml(BaseEntity e)
 {
     XmlDocument xml = e.ToXmlDocument();
     Assert.IsNotNull(xml);
     Assert.IsNotNullOrEmpty(xml.InnerXml);
     Trace.WriteLine(xml.InnerXml);
 }
开发者ID:popovegor,项目名称:gt,代码行数:7,代码来源:EntityTestFixture.cs


示例13: AddFeedback

 public static DataRow AddFeedback(BaseEntity feedback)
 {
     using (DbCommand cmd = DB.Gt.GetStoredProcCommand(ProcNames.AddFeedback))
       {
     DB.Gt.AddInParameter(cmd, "@Feedback", DbType.Xml, feedback.ToXmlString());
     return DB.Gt.ExecuteDataRow(cmd);
       }
 }
开发者ID:popovegor,项目名称:gt,代码行数:8,代码来源:SupportDataAdapter.cs


示例14: AddImage

 public static DataRow AddImage(BaseEntity sellingImage)
 {
     using (DbCommand cmd = DB.Gt.GetStoredProcCommand(ProcNames.AddImage))
       {
     DB.Gt.AddInParameter(cmd, "@SellingImage", DbType.Xml, sellingImage.ToXmlString());
     return DB.Gt.ExecuteDataRow(cmd);
       }
 }
开发者ID:popovegor,项目名称:gt,代码行数:8,代码来源:SellingDataAdapter.cs


示例15: getAmmoType

 public static ItemDefinition getAmmoType(BaseEntity pro)
 {
     var pro1 = pro as BaseProjectile;
     if (pro1 == null)
         return null;
     //ConsoleSystem.Broadcast("chat.add", new object[] { 0, pro1.primaryMagazine.ammoType.ToString() });
     return pro1.primaryMagazine.ammoType;
 }
开发者ID:stuffedmotion,项目名称:plugins,代码行数:8,代码来源:EventDead.cs


示例16: Add

 public static DataRow Add(BaseEntity news)
 {
     using (DbCommand cmd = DB.Gt.GetStoredProcCommand(AddProcName))
     {
         DB.Gt.AddInParameter(cmd, "@News", DbType.Xml, news.ToXmlString());
         return DB.Gt.ExecuteDataRow(cmd);
     }
 }
开发者ID:popovegor,项目名称:gt,代码行数:8,代码来源:NewsDataAdapter.cs


示例17: PrepareForStorage

        public BaseEntity PrepareForStorage(BaseEntity entity)
        {
            var validatedEntity = entity.Clone ();

            // TODO: Add validation

            return validatedEntity;
        }
开发者ID:CompulsiveCoder,项目名称:gitdb-cs,代码行数:8,代码来源:DataPreparer.cs


示例18: CommitLinks

        public virtual void CommitLinks(BaseEntity entity)
        {
            if (Settings.IsVerbose)
                Console.WriteLine ("  Committing all links for '"  + entity.GetType().Name + "'.");

            var previousEntity = Reader.Read(entity.GetType(), entity.Id);

            FindAndFixDifferences (previousEntity, entity);
        }
开发者ID:CompulsiveCoder,项目名称:gitdb-cs,代码行数:9,代码来源:DataLinker.cs


示例19: DestroyBulletCollision

        public override void DestroyBulletCollision(BaseEntity entity)
        {
            base.DestroyBulletCollision(entity);

            if (followingEnemy != null && followingEnemy is BaseEnemy)
            {
                (followingEnemy as BaseEnemy).IsFollowed = false;
            }
        }
开发者ID:amidos2006,项目名称:CleanEmUp,代码行数:9,代码来源:HomigRocketBullet.cs


示例20: Add

 public static DataRow Add(BaseEntity wm)
 {
     using (DbCommand cmd = DB.Gt.GetStoredProcCommand(AddProcName))
     {
         DB.Gt.AddInParameter(cmd, "@wm", DbType.Xml, wm.ToXmlString());
         DataRow dr = DB.Gt.ExecuteDataRow(cmd);
         return dr;
     }
 }
开发者ID:popovegor,项目名称:gt,代码行数:9,代码来源:WebMoneyDataAdapter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# BaseEvent类代码示例发布时间:2022-05-24
下一篇:
C# BaseCreature类代码示例发布时间: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