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


C# BaseEntity类代码示例

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


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


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