コード例 #1
0
ファイル: AIComponent.cs プロジェクト: MoyTW/SpaceDodgeRL
        public List <EncounterAction> DecideNextAction(EncounterState state, Entity parent)
        {
            if (!state.GroupActivated(this.ActivationGroupId))
            {
                var position = parent.GetComponent <PositionComponent>().EncounterPosition;
                if (state.FoVCache.IsVisible(position.X, position.Y))
                {
                    state.ActivateGroup(this.ActivationGroupId);
                }
                else
                {
                    return(new List <EncounterAction>()
                    {
                        new WaitAction(parent.EntityId)
                    });
                }
            }

            return(_DecideNextAction(state, parent));
        }