public Behaviour(Blob blob) { this.Triggered = false; firstRound = true; this.blob = blob; }
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); }
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; }
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; }
public Attack(Blob blob) { this.user = blob; }
public void Attack(Blob target) { target.Health -= this.AttackType.Execute(); }
public Inflated(Blob blob) : base(blob) { }
public void AddBlob(Blob blob) { this.Blobs.AddLast(blob); }
public Aggressive(Blob blob) : base(blob) { initialDamage = blob.Damage; }
public Blobplode(Blob blob) : base(blob) { }
public PutridFart(Blob blob) : base(blob) { }