コード例 #1
0
        /// <summary>
        /// Performed in different thread in loop task each time
        /// we receive new coordinates and vector
        /// </summary>
        public override void Job()
        {
            try
            {
                _publisher.Detach(this);
                BallCoordinates  ballCoordinates = _currentData;//_publisher.Data;
                List <RodAction> actions         = _manager.Decide(ballCoordinates);
                foreach (RodAction action in actions)
                {
                    RodActionPublishers[action.RodType].UpdateAndNotify(action);

                    Marks.DrawRods();
                    Marks.DrawRodPlayers(action.RodType, action.DcCoordinate, action.Rotation);

                    //Log.Common.Debug(String.Format("[{0}] mm", action.DcCoordinate));
                }
            }
            catch (Exception ex)
            {
                Log.Print("No vectors found!", eCategory.Error, LogTag.DECISION);
            }
            finally
            {
                _publisher.Attach(this);
            }
        }