public void RemoveFlockEntity(FlockEntity flockEntity) { if (this.flockMembers.ContainsKey(flockEntity.Id)) { this.flockMembers.Remove(flockEntity.Id); } }
private static void CreateCow(Flock flock, Vector2 startPosition, Vector2 startHeading) { //Creating cow Texture2D cowTexture = MainGame.Instance.Content.Load<Texture2D>(COW_TEXTURE_NAME); FlockEntity cow = new FlockEntity(EntityManager.EntityType.FlockMember, cowTexture, COW_WRAPS_AROUND, flock) { Scale = COW_SCALE, Position = startPosition, Heading = startHeading }; //Adding behaviour new ConstantPropulsion(cow, COW_PROPULSION); new FlockSteering(cow, COW_STEERING_FORCE); new Flee(cow, EntityManager.EntityType.Turret, COW_PROPULSION_INCREMENT, COW_FLEE_DETECTION_DISTANCE); new Flee(cow, EntityManager.EntityType.Projectile, COW_PROPULSION_INCREMENT, COW_FLEE_DETECTION_DISTANCE); }
////////////////////////////// //Constructors// ////////////////////////////// public FlockSteering(FlockEntity host, float steerForce) : base(host) { this.steerForce = steerForce; }
//Methods public void InsertFlockEntity(FlockEntity flockEntity) { this.flockMembers[flockEntity.Id] = flockEntity; }