Ejemplo n.º 1
0
        private void DrawBasicData(SpriteBatch spriteBatch, Character character, int offset = 0)
        {
            actualRow = 0;
            int row = nextRow();
            DrawCenteredString(spriteBatch, character.Name, row + offset);

            row = nextRow();
            DrawIcon(spriteBatch, ImageProvider.Instance.GetImage(ImageListEnum.TOKENS_DAMAGE_ICON), row + offset);
            DrawString(spriteBatch, character.LivesState(), row + offset);

            row = nextRow();
            DrawIcon(spriteBatch, ImageProvider.Instance.GetImage(ImageListEnum.TOKENS_MOVE_ICON), row + offset);
            DrawString(spriteBatch, character.MovementState(), row + offset);
        }
Ejemplo n.º 2
0
 private void DrawDefense(SpriteBatch spriteBatch, Character character, int row)
 {
     var i = 0;
     foreach (var dice in character.GetDefenseDices())
     {
         spriteBatch.Draw(ImageProvider.Instance.GetImage(dice.GetIcon()), position: new Vector2(Rect.X + 50 + i * 30, 190 + row * 40));
         i++;
     }
 }
Ejemplo n.º 3
0
        private void ShowPossibleActions(Character character)
        {
            ClearButtons();

            if (character != null)
            {
                List<IAction> actions = character.GetPossibleActions();

                var i = 0;
                foreach (var action in actions)
                {
                    var labelSize = FontFactory.Font.MeasureString(action.GetLabel());
                    TextGameButton button = new TextGameButton(new Vector2(labelSize.X / 2 + 40, 40), new Vector2(Rect.X + Rect.Width / 2 - (labelSize.X / 2 + 40) / 2, 500 + 50 * i), action.GetLabel());
                    button.Show();
                    button.RegisterCallbackObject(action);
                    button.RegisterOnClick(OnActionClick);
                    buttons.Add(button);
                    i++;
                }
            }
        }
Ejemplo n.º 4
0
 public virtual bool CanGoThrough(Character other)
 {
     return !IsEnemy(other);
 }
Ejemplo n.º 5
0
 public bool IsEnemy(Character other)
 {
     return GetSide() != other.GetSide();
 }
Ejemplo n.º 6
0
 public int DistanceFrom(Character character)
 {
     return Position.DistanceFrom(character.Position);
 }
Ejemplo n.º 7
0
 public CombatResolver(Character attacker, Character defender)
 {
     Attacker = attacker;
     Defender = defender;
 }
Ejemplo n.º 8
0
 public CharacterSelectedEvent(object source, Character character)
 {
     Character = character;
 }