Exemplo n.º 1
0
        public override bool Validate(GameObject caster, object target)
        {
            var unitCount = Board.Instance.Cells.Select(c => c.OccupiedBy)
                            .Count(e => e != null && e.IsAlive() && e.GetComponent <UnitComponent>().Id == this.data.UnitId);

            return(Comparator.Compare(unitCount, this.data.Value, this.data.Comparator));
        }
Exemplo n.º 2
0
        public override bool Validate(GameObject caster, object target)
        {
            var behaviours = caster.GetComponent <BehavioursComponent>();

            return(Comparator.Compare(
                       behaviours.Behaviours.Where(b => b.Id == this.data.BehaviourId).Sum(b => b.StackCount),
                       this.data.Value,
                       this.data.Comparator
                       ));
        }
Exemplo n.º 3
0
        public override bool Validate(GameObject caster, object target)
        {
            var targetAsGameObject = target as GameObject;

            if (targetAsGameObject == null)
            {
                return(false);
            }

            var health = targetAsGameObject.GetComponent <HealthComponent>();

            return(health != null && Comparator.Compare(health.HealthFraction, this.data.Fraction, this.data.Comparator));
        }
Exemplo n.º 4
0
        public override bool Validate(GameObject caster, object target)
        {
            var targetAsGameObject = target as GameObject;

            if (targetAsGameObject == null)
            {
                return(false);
            }

            var unit = targetAsGameObject.GetComponent <UnitComponent>();

            if (unit == null)
            {
                return(false);
            }

            return(Comparator.Compare(unit.ChallengeRating, this.data.Value, this.data.Comparator));
        }
Exemplo n.º 5
0
        public override bool Validate(GameObject caster, object target)
        {
            var targetAsGameObject = target as GameObject;

            if (targetAsGameObject == null)
            {
                return(false);
            }

            var behavioursComponent = targetAsGameObject.GetComponent <BehavioursComponent>();

            if (behavioursComponent == null)
            {
                return(false);
            }

            return(Comparator.Compare(
                       behavioursComponent.Behaviours.Where(b => b.Id == this.data.BehaviourId).Sum(b => b.StackCount),
                       this.data.Value,
                       this.data.Comparator
                       ));
        }