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


C# ICharacter类代码示例

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


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

示例1: ExecuteCommand

 public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
 {
     Vendor v = Pool.Instance.GetObject<Vendor>(character.Playfield.Identity, target);
     if (v != null)
     {
         int pfid = character.Playfield.Identity.Instance;
         StatelData sd =
             PlayfieldLoader.PFData[pfid].Statels.FirstOrDefault(x => x.Identity.Equals(v.OriginalIdentity));
         if (sd != null)
         {
             int instance = (((sd.Identity.Instance) >> 16) & 0xff
                             | (character.Playfield.Identity.Instance << 16));
             DBVendor dbv = new DBVendor();
             dbv.Id = instance;
             dbv.Playfield = pfid;
             dbv.X = sd.X;
             dbv.Y = sd.Y;
             dbv.Z = sd.Z;
             dbv.HeadingX = sd.HeadingX;
             dbv.HeadingY = sd.HeadingY;
             dbv.HeadingZ = sd.HeadingZ;
             dbv.HeadingW = sd.HeadingW;
             dbv.Name = "New shop, please fill me";
             dbv.TemplateId = sd.TemplateId;
             dbv.Hash = "";
             VendorDao.Instance.Delete(dbv.Id);
             VendorDao.Instance.Add(dbv, dontUseId: false);
         }
     }
 }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:30,代码来源:MakeShop.cs

示例2: Input

        private void Input(ICharacter player)
        {
            var info = Console.ReadKey();

            switch (info.Key)
            {
                case ConsoleKey.Spacebar:
                    var ninja = Enemies.FirstOrDefault();

                    player.Atack(ninja);

                    if (ninja != null && ninja.Blood == 0)
                    {
                        Enemies.Remove(ninja);
                    }
                    break;

                case ConsoleKey.LeftArrow:
                    player.Move(Direction.Left);
                    break;

                case ConsoleKey.UpArrow:
                    player.Move(Direction.Up);
                    break;

                case ConsoleKey.RightArrow:
                    player.Move(Direction.Right);
                    break;

                case ConsoleKey.DownArrow:
                    player.Move(Direction.Down);
                    break;
            }
        }
开发者ID:jcrey,项目名称:Scio.CSharp.Training,代码行数:34,代码来源:TheKidnapLevel.cs

示例3: AddText

		public void AddText(ICharacter character, params string[] sentences)
		{
			foreach (string sentence in sentences)
			{
				Actions.Add(new AGSDialogAction (character, sentence));
			}
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:AGSDialogActions.cs

示例4: SetScaling

    /// <summary>
    /// Sets the stat scaling on this weapon based on the user character's selected attribute. </summary>
    /// <param name='userStats'> User character's stat module. </param>
    public void SetScaling(ICharacter user)
    {
        switch (scalingAttribute) {
                case CharacterAttribute.AttributeName.Vitality:
                        _scalingAtt = user.CharStats.Vitality;
                        break;
                case CharacterAttribute.AttributeName.Endurance:
                        _scalingAtt = user.CharStats.Endurance;
                        break;
                case CharacterAttribute.AttributeName.Spirit:
                        _scalingAtt = user.CharStats.Spirit;
                        break;
                case CharacterAttribute.AttributeName.Strength:
                        _scalingAtt = user.CharStats.Strength;
                        break;
                case CharacterAttribute.AttributeName.Dexterity:
                        _scalingAtt = user.CharStats.Dexterity;
                        break;
                case CharacterAttribute.AttributeName.Mind:
                        _scalingAtt = user.CharStats.Mind;
                        break;
                default:
                        _scalingAtt = null;
                        break;
                }

                if (_scalingAtt == null)
                        Debug.Log ("no scaling attribute set!");
    }
开发者ID:benmirath,项目名称:Transcension,代码行数:32,代码来源:ScalingStat.cs

示例5: Hit

        public virtual int Hit(ICharacter enemy)
        {
            int damage = (this.Damage +this.Master.AttackPoints/10)*(1000 - enemy.DefencePoints)/1000;
            enemy.HealthPoints -= damage;

            return damage;
        }
开发者ID:Team-Camaron,项目名称:SeaAdventures,代码行数:7,代码来源:Skill.cs

示例6: Update

        public override void Update(GameTime gameTime, ICharacter character)
        {
            this.TimeSinceLastFrame += gameTime.ElapsedGameTime.Milliseconds;
            if (this.TimeSinceLastFrame < this.TimePerFrame)
            {
                return;
            }
            this.TimeSinceLastFrame = gameTime.ElapsedGameTime.Milliseconds;

            KeyboardState keyState = Keyboard.GetState();

            bool moving = ((Player)character).KbKeys.Any(key => keyState.IsKeyDown(key));

            if (moving || this.CurrentFrame != 5)
            {
                if (this.reverse)
                {
                    this.CurrentFrame--;
                }
                else
                {
                    this.CurrentFrame++;
                }

                if (this.CurrentFrame == this.TotalFrames - 1 || this.CurrentFrame == 0)
                {
                    this.reverse = !this.reverse;
                }
            }
        }
开发者ID:Rattatak,项目名称:LeGame,代码行数:30,代码来源:PlayerRotationSprite.cs

示例7: OccupancyChangedEventArgs

 /// <summary>
 /// Initializes a new instance of the <see cref="OccupancyChangedEventArgs"/> class.
 /// </summary>
 /// <param name="occupant">The occupant.</param>
 /// <param name="departureRoom">The departure room.</param>
 /// <param name="arrivalRoom">The arrival room.</param>
 public OccupancyChangedEventArgs(ICharacter occupant, ITravelDirection travelDirection, DefaultRoom departureRoom, DefaultRoom arrivalRoom)
 {
     this.Occupant = occupant;
     this.DepartureRoom = departureRoom;
     this.ArrivalRoom = arrivalRoom;
     this.TravelDirection = travelDirection;
 }
开发者ID:ramseur,项目名称:MudDesigner,代码行数:13,代码来源:OccupancyChangedEventArgs.cs

示例8: MapToEntity

 public virtual void MapToEntity(ICharacterModel model, ref ICharacter entity, int currentDepth = 1)
 {
     currentDepth++;
     // Assign Base properties
     NameableEntityMapper.MapToEntity(model, ref entity);
     // Character Properties
     entity.RealName = model.RealName;
     entity.DateOfBirth = model.DateOfBirth;
     // Related Objects
     entity.PrimaryImageFileId = model.PrimaryImageFileId;
     entity.PrimaryImageFile = (ImageFile)model.PrimaryImageFile?.MapToEntity();
     entity.FirstIssueAppearanceId = model.FirstIssueAppearanceId;
     entity.FirstIssueAppearance = (Issue)model.FirstIssueAppearance?.MapToEntity();
     entity.GenderId = model.GenderId;
     entity.Gender = (Gender)model.Gender?.MapToEntity();
     entity.OriginId = model.OriginId;
     entity.Origin = (Origin)model.Origin?.MapToEntity();
     entity.PublisherId = model.PublisherId;
     entity.Publisher = (Publisher)model.Publisher?.MapToEntity();
     // Associated Objects
     entity.CharacterAliases = model.CharacterAliases?.Where(i => i.Active).Select(CharacterAliasMapperExtensions.MapToEntity).ToList();
     entity.CharacterCreators = model.CharacterCreators?.Where(i => i.Active).Select(CharacterCreatorMapperExtensions.MapToEntity).ToList();
     entity.CharacterEnemies = model.CharacterEnemies?.Where(i => i.Active).Select(CharacterEnemyMapperExtensions.MapToEntity).ToList();
     entity.CharacterEnemyTeams = model.CharacterEnemyTeams?.Where(i => i.Active).Select(CharacterEnemyTeamMapperExtensions.MapToEntity).ToList();
     entity.CharacterFriends = model.CharacterFriends?.Where(i => i.Active).Select(CharacterFriendMapperExtensions.MapToEntity).ToList();
     entity.CharacterFriendlyTeams = model.CharacterFriendlyTeams?.Where(i => i.Active).Select(CharacterFriendlyTeamMapperExtensions.MapToEntity).ToList();
     entity.CharacterIssuesAppearedIn = model.CharacterIssuesAppearedIn?.Where(i => i.Active).Select(CharacterAppearedInIssueMapperExtensions.MapToEntity).ToList();
     entity.CharacterIssuesDiedIn = model.CharacterIssuesDiedIn?.Where(i => i.Active).Select(CharacterDiedInIssueMapperExtensions.MapToEntity).ToList();
     entity.CharacterIssues = model.CharacterIssues?.Where(i => i.Active).Select(CharacterIssueMapperExtensions.MapToEntity).ToList();
     entity.CharacterMovies = model.CharacterMovies?.Where(i => i.Active).Select(CharacterMovieMapperExtensions.MapToEntity).ToList();
     entity.CharacterPowers = model.CharacterPowers?.Where(i => i.Active).Select(CharacterPowerMapperExtensions.MapToEntity).ToList();
     entity.CharacterStoryArcs = model.CharacterStoryArcs?.Where(i => i.Active).Select(CharacterStoryArcMapperExtensions.MapToEntity).ToList();
     entity.CharacterTeams = model.CharacterTeams?.Where(i => i.Active).Select(CharacterTeamMapperExtensions.MapToEntity).ToList();
     entity.CharacterVolumes = model.CharacterVolumes?.Where(i => i.Active).Select(CharacterVolumeMapperExtensions.MapToEntity).ToList();
 }
开发者ID:Jothay,项目名称:comic-vinescraper-api,代码行数:35,代码来源:Characters.CharacterMappings.cs

示例9: CheckHandPower

        //TODO:from int to double return type
        public void CheckHandPower(ICharacter player, IList<ICard> tableCards)
        {
            decimal powerToSet = 0;

            powerToSet = CheckFourOfKind(player, tableCards);
            if (powerToSet >= initialPowerFourOfKind)
            {
                player.Power = powerToSet;
                return;
            }

            powerToSet = CheckForFullHouse(player, tableCards);
            if (powerToSet >= initialPowerFullHouse)
            {
                player.Power = powerToSet;
                return;
            }


            powerToSet = CheckForFlush(player, tableCards);
            if (powerToSet >= initialPowerFlush)
            {
                player.Power = powerToSet;
                return;
            }

            powerToSet = CheckForStraight(player, tableCards);
            if (powerToSet >= initialPowerStraight)
            {
                player.Power = powerToSet;
                return;
            }

            powerToSet = CheckForThreeOfKind(player, tableCards);
            if (powerToSet >= initialPowerThreeOfKind)
            {
                player.Power = powerToSet;
                return;
            }

            powerToSet = CheckForTwoPair(player, tableCards);
            if (powerToSet >= initialPowerTwoPair)
            {
                player.Power = powerToSet;
                return;
            }

            powerToSet = CheckForOnePair(player, tableCards);
            if (powerToSet >= initialPowerOnePair)
            {
                player.Power = powerToSet;
                return;
            }

            powerToSet = CheckForHighCard(player);
            if (powerToSet >= 1)
            {
                player.Power = powerToSet;
            }
        }
开发者ID:SavaIvanov9,项目名称:HQC---Team-Project---Papaya,代码行数:61,代码来源:Dealer.cs

示例10: Character

 //
 // This constructor's purpose is entirely for making a deep copy of the object type
 //
 public Character(ICharacter c)
 {
     foreach (var property in typeof(Character).GetProperties())
     {
         property.SetValue(this, property.GetValue(c));
     }
 }
开发者ID:tokera,项目名称:Telerik-Academy,代码行数:10,代码来源:Character.cs

示例11: Choose

        private int Choose(ICharacter player)
        {
            ICharacter target = new Enemy();

            var random = new Random();

            ConsoleKeyInfo option = Console.ReadKey(true);

            switch (option.Key)
            {
                case ConsoleKey.Escape:
                    Environment.Exit(0);
                    break;

                case ConsoleKey.A:
                    player.Move(Direction.Up);
                    break;

                case ConsoleKey.B:
                    player.Atack(target);
                    break;
                
            }

            return random.Next(0, 1980);
        }
开发者ID:jcrey,项目名称:Scio.CSharp.Training,代码行数:26,代码来源:TheLostCavernsOfTsojcanth.cs

示例12: ToStringModelView

 public static void ToStringModelView(ICharacter c, int nest, StringBuilder sb, out bool oneLiner)
 {
     if (c is Sprite)
     {
         ((Sprite)c).ToStringModelView(nest, sb, out oneLiner);
     }
     else if (c is EditText)
     {
         ((EditText)c).ToStringModelView(nest, sb, out oneLiner);
     }
     else if (c is StaticText)
     {
         ((StaticText)c).ToStringModelView(nest, sb, out oneLiner);
     }
     else if (c is IImage)
     {
         ((IImage)c).ToStringModelView(nest, sb, out oneLiner);
     }
     else if (c is IShape)
     {
         ((IShape)c).ToStringModelView(nest, sb, out oneLiner);
     }
     else
     {
         throw new Exception("*** ERROR: CAN'T DUMP: " + c.ToString());
     }
 }
开发者ID:WeeWorld,项目名称:Swiffotron,代码行数:27,代码来源:CharacterDump.cs

示例13: Decide

 public override void Decide(ICharacter character, IList<ICard> cardCollection,
                            int firstCard, int secondCard, int botChips,
                            bool isFinalTurn, Label hasFolded, int botIndex,
                            double botPower, double behaviourPower, int callSum)
 {
     this.IsOnTurn = true;
 }
开发者ID:john6tain,项目名称:Poker-Mechanics,代码行数:7,代码来源:Player.cs

示例14: RaiseAction

 public void RaiseAction(ICharacter character, int raise, ISingleBet bet)
 {
     character.HasRaised = true;
     character.Raise(raise);
     bet.AddBet(raise);
     bet.LastBet = raise;
 }
开发者ID:TeamAvocadoUni,项目名称:PokerStars,代码行数:7,代码来源:GameActions.cs

示例15: EnemyAI

	public EnemyAI(ICharacter Character, Vector3 AttackPosition):base(Character)
	{
		m_AttackPosition = AttackPosition;

		// 一開始起始的狀態
		ChangeAIState(new IdleAIState());
	}
开发者ID:jardar,项目名称:PBaseDefense_Unity3D,代码行数:7,代码来源:EnemyAI.cs


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