private static void CreateCommand(BlobDatabase database, string[] tokens) { var name = tokens[1]; var health = int.Parse(tokens[2]); var damage = int.Parse(tokens[3]); var behaviourType = tokens[4]; var attackType = tokens[5]; var createdBlob = new Blob(name, health, damage, behaviourType == "Aggressive" ? (IBehavior) new AggressiveBehavior() : new InflatedBehavior(), attackType == "PutridFart" ? (IAttack) new PutridFart() : new Blobplode()); database.Add(createdBlob); }
public void Attack(Blob targetBlob) { if (IsAlive && targetBlob.IsAlive) { BlobAttack.Attack(this, targetBlob); if (this.BlobBehavior is AggressiveBehavior && targetBlob.Health <= targetBlob.InitialHealth) { this.BlobBehavior.Trigger(this); } } }
public abstract void ProduceAttackDamage(Blob blob);