Esempio 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);
        }
Esempio 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++;
     }
 }
Esempio 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++;
                }
            }
        }
Esempio n. 4
0
 public virtual bool CanGoThrough(Character other)
 {
     return !IsEnemy(other);
 }
Esempio n. 5
0
 public bool IsEnemy(Character other)
 {
     return GetSide() != other.GetSide();
 }
Esempio n. 6
0
 public int DistanceFrom(Character character)
 {
     return Position.DistanceFrom(character.Position);
 }
Esempio n. 7
0
 public CombatResolver(Character attacker, Character defender)
 {
     Attacker = attacker;
     Defender = defender;
 }
Esempio n. 8
0
 public CharacterSelectedEvent(object source, Character character)
 {
     Character = character;
 }