public void RemoveComponent(IAIComponent component) { if (AIComponents.Contains(component)) { AIComponents.Remove(component); } }
public void AddComponent(IAIComponent component) { if (!AIComponents.Contains(component)) { AIComponents.Add(component); } }
public Enemy(World world, EnemyData data) : base(world) { _isAction = false; _sightRadius = data.SightRadius; this.Texture = data.Texture; this.Velocity = data.Velocity; this.AnimatedSprites = data.DeepCopySprites; this._idleComponent = data.IdleComponent.Clone(); this._decisionComponent = data.DecisionComponent.Clone(); this._actionComponents = data.DeepCopyActionComponents; this.LeftCollisionOffset = data.LeftCollisionOffset; this.RightCollisionOffset = data.RightCollisionOffset; this.TopCollisionOffset = data.TopCollisionOffset; this.BottomCollisionOffset = data.BottomCollisionOffset; this._health = new AttributePair(data.Health); this.AnimatedSprites.First().Value.IsAnimating = true; _healthTexture = world.Game.Content.Load<Texture2D>(@"Gui/EnemyHealthBar"); String[] color = data.Color.Split(','); if(color.Length == 3) _tintColor = new Color(int.Parse(color[0]), int.Parse(color[1]), int.Parse(color[2])); foreach (AnimatedSprite sprite in AnimatedSprites.Values) { sprite.TintColor = _tintColor; } }
public virtual void dispose() { unRegisterEvt(); this._npcAIComponent = null; this._aiContext = null; this._aiStateManager = null; this._host = null; }
public BaseMonsterAIState(IAIComponent monsterAIComponent) { this._monsterAIComponent = monsterAIComponent; this._aiContext = monsterAIComponent as IAIContext; this._aiStateManager = monsterAIComponent as IAIStateManager; this._host = monsterAIComponent.host(); init(); }
public BaseNPCAIState(IAIComponent npcAIComponent) { this._npcAIComponent = npcAIComponent; this._aiContext = npcAIComponent as IAIContext; this._aiStateManager = npcAIComponent as IAIStateManager; this._host = npcAIComponent.host(); init(); }
public AIAttractedState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public DrowningState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public AIFreeState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public AIPreAttack(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public NPCFollowPlayerState(IAIComponent npcAIComponent) : base(npcAIComponent) { }
public AIRunAwayState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public AIAttackState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public AIBeHitState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public AIBreedState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { _random = new System.Random(); _breedRate = DataManagerM.Instance.getMonsterDataManager().getBreedDate(_host).breedRate; }
public LodgedAttackState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public LodgedFreeState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public LodgedRoamState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public AIAimState(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public LodgedPreAttack(IAIComponent monsterAIComponent) : base(monsterAIComponent) { }
public NPCIdleState(IAIComponent npcAIComponent) : base(npcAIComponent) { }
public NPCRoamState(IAIComponent npcAIComponent) : base(npcAIComponent) { }