Example #1
0
        public Behaviour(Blob blob)
        {
            this.Triggered = false;
            firstRound = true;
            this.blob = blob;

        }
Example #2
0
        public override void Execute(params string[] commandParams)
        {
            string name = commandParams[0];
            int health = int.Parse(commandParams[1]);
            int damage = int.Parse(commandParams[2]);
            string behaviour = commandParams[3];
            string attack = commandParams[4];

            Blob blob = new Blob(name, health, damage, behaviour, attack);
            this.Engine.FieldOfPLay.AddBlob(blob);
        }
Example #3
0
        public IBehaviour CreateBehaviour(string behaviour, Blob blob)
        {
            var behaviourType = Assembly.GetExecutingAssembly()
             .GetTypes()
             .FirstOrDefault(c => c.CustomAttributes.Any(a => a.AttributeType == typeof(BehaviourAttribute)) &&
                                     c.Name == behaviour);

            if (behaviourType == null)
            {
                throw new ArgumentNullException("behaviourType", "Unknown behaviour");
            }

            var behaviourInstance = Activator.CreateInstance(behaviourType, blob) as IBehaviour;

            return behaviourInstance;
        }
Example #4
0
        public IAttack CreateAttack(string typeOfAttack, Blob blob)
        {
            var attackType = Assembly.GetExecutingAssembly()
              .GetTypes()
              .FirstOrDefault(c => c.CustomAttributes.Any(a => a.AttributeType == typeof(AttackAttribute)) &&
                                      c.Name == typeOfAttack);

            if (attackType == null)
            {
                throw new ArgumentNullException("attackType", "Unknown attack");
            }

            var attack = Activator.CreateInstance(attackType, blob) as IAttack;

            return attack;
        }
Example #5
0
 public Attack(Blob blob)
 {
     this.user = blob;
 }
Example #6
0
 public void Attack(Blob target)
 {
    target.Health -= this.AttackType.Execute();
 }
Example #7
0
 public Inflated(Blob blob) : base(blob)
 {
 }
Example #8
0
 public void AddBlob(Blob blob)
 {
     this.Blobs.AddLast(blob);
 }
Example #9
0
 public Aggressive(Blob blob) : base(blob)
 {
     initialDamage = blob.Damage;
 }
Example #10
0
 public Blobplode(Blob blob) : base(blob)
 {
 }
Example #11
0
        public PutridFart(Blob blob) : base(blob)
        {

        }