Ejemplo n.º 1
0
 /// <summary>
 /// Slouzi pro klonovani
 /// </summary>
 /// <param name="unit"></param>
 /// <param name="not"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="atribut"></param>
 public Unit(Unit unit, Notoriety not, int x, int y, AttributePair atribut)
     : base(unit.attack, unit.defense, unit.animatedSprite, x, y)
 {
     Name = unit.Name;
     Notoriety = not;
     isInHero = false;
     HitPoints = atribut;
 }
Ejemplo n.º 2
0
 public Unit(
     string name,
     int attack,
     int defense,
     AnimatedSprite animatedSprite,
     int x,
     int y,
     AttributePair atribut)
     : base(attack, defense, animatedSprite, x, y)
 {
     Name = name;
     isInHero = false;
     HitPoints = atribut;
 }
 public Character(
 int attack,
 int defense,
 AnimatedSprite sprite,
     int x,
     int y)
 {
     Attack = attack;
     Defense = defense;
     animatedSprite = sprite;
     animatedSprite.IsAnimating = true;
     HitPoints = new AttributePair();
     Cell = new Point(x, y);
     Position = Session.FrontMap.CellToVector(Cell) + Session.Camera.Position;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Klonovani pri deserializaci
        /// </summary>
        /// <param name="not"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="attack"></param>
        /// <param name="defense"></param>
        /// <param name="atribut"></param>
        /// <param name="isInHero"></param>
        /// <returns></returns>
        public Unit Clone(Notoriety not, int x, int y, int attack, int defense, AttributePair atribut,bool isInHero)
        {
            AnimatedSprite sprite = (AnimatedSprite)this.animatedSprite.Clone();
            Unit unitClone = new Unit(this.Name, this.Attack, this.Defense, sprite, x, y, atribut);
            Unit unitClone2 = new Unit(unitClone, not, x, y, this.HitPoints);
            unitClone2.attack = attack;
            unitClone2.defense = defense;
            unitClone2.HitPoints = atribut;
            unitClone2.isInHero = isInHero;

            return unitClone2;
        }