Esempio n. 1
0
        private List <Option> BuildOptionList(List <BoardPosition> moves, List <Target> oldTargets, TeamName teamName)
        {
            OptionBuilder builder = new OptionBuilder(teamName);
            List <Option> options = new List <Option>();

            moves.ForEach(x => options.Add(builder.BuildOption(x, _currentBoard, oldTargets)));
            return(options);
        }
Esempio n. 2
0
        void OnDrawGizmos()
        {
            if (_moves != null)
            {
                OptionBuilder builder = new OptionBuilder(_myTeam);

                foreach (BoardPosition bp in _moves)
                {
                    Option option = builder.BuildOption(bp, _currentBoard, _myTargets);
                    foreach (Target t in option.Targets)
                    {
                        Gizmos.DrawCube(t.TargetPosition.Position, new Vector2(.25f, .25f));
                        Vector2  labelPos = new Vector2(t.TargetPosition.Position.x, t.TargetPosition.Position.y + .75f);
                        GUIStyle style    = new GUIStyle();
                        Handles.Label(labelPos, t.GetFourCost(_currentBoard, _myTeam).ToString(), style);
                        Gizmos.color = Color.gray;
                        t.MovesRequiredToFillPath.ForEach(x => Gizmos.DrawSphere(x.Position, .25f));
                        Gizmos.color = Color.green;
                        t.Path.ForEach(x => Gizmos.DrawSphere(x.Position, .15f));
                    }
                }
            }
            if (_selectedTarget != null)
            {
                Gizmos.color = Color.yellow;
                Gizmos.DrawSphere(_selectedTarget.TargetPosition.Position, .25f);
            }
            if (_enemySelectedTarget != null)
            {
                Gizmos.color = Color.magenta;
                Gizmos.DrawWireSphere(_enemySelectedTarget.TargetPosition.Position, .45f);
            }
            if (_enemyTargets != null && _enemyTargets.Count > 0)
            {
                Gizmos.color = Color.red;
                _enemyTargets.ForEach(x => Gizmos.DrawWireSphere(x.TargetPosition.Position, .25f));
            }
        }