當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。