Ejemplo n.º 1
0
        public SiusDataMessage Parse(RawMessage rawMessage)
        {
            if (!rawMessage.IsResponsible(Identifier, ValueCount))
            {
                return(null);
            }

            string[] valueList = rawMessage.Values.ToArray();

            SuccessHelper allOverSuccess = new SuccessHelper();
            int           shooterNumber  = ValueAccessHelper.GetInt(valueList, ShooterNumber, allOverSuccess);
            int           laneId         = ValueAccessHelper.GetInt(valueList, LaneId, allOverSuccess);
            int           laneNumber     = ValueAccessHelper.GetInt(valueList, LaneNumber, allOverSuccess);
            DateTime      timestamp      = ValueAccessHelper.GetDateTime(valueList, Timestamp, allOverSuccess);

            if (!allOverSuccess.Success)
            {
                return(null);
            }
            return(_messageFactory.MakePrchMessage(shooterNumber, laneId, laneNumber, timestamp));
        }
Ejemplo n.º 2
0
        public SiusDataMessage Parse(RawMessage rawMessage)
        {
            if (!rawMessage.IsResponsible(Identifier, ValueCount))
            {
                return(null);
            }

            string[] valueList = rawMessage.Values.ToArray();

            SuccessHelper allOverSuccess = new SuccessHelper();
            int           laneId         = ValueAccessHelper.GetInt(valueList, LaneId, allOverSuccess);
            int           laneNumber     = ValueAccessHelper.GetInt(valueList, LaneNumber, allOverSuccess);
            int           shooterId      = ValueAccessHelper.GetInt(valueList, ShooterId, allOverSuccess);
            DateTime      timstamp       = ValueAccessHelper.GetDateTime(valueList, DateTime, allOverSuccess);
            int           shotType       = ValueAccessHelper.GetInt(valueList, ShotType, allOverSuccess);
            decimal       primaryScore   = ValueAccessHelper.GetDecimal(valueList, PrimaryScore, allOverSuccess);
            decimal       secondaryScore = ValueAccessHelper.GetDecimal(valueList, SecondaryScore, allOverSuccess);
            int           shotNbr        = ValueAccessHelper.GetInt(valueList, ShotNbr, allOverSuccess);
            //float x = ValueAccessHelper.GetFloat(valueList, X, allOverSuccess);
            //float y = ValueAccessHelper.GetFloat(valueList, Y, allOverSuccess);
            int programNumber = ValueAccessHelper.GetInt(valueList, ProgramNumber, allOverSuccess);

            if (!allOverSuccess.Success)
            {
                return(null);
            }
            SiusDataMessage message = null;

            switch (shotType)
            {
            case 2:
                message = _messageFactory.MakeBestShotMessage(shooterId, laneId, laneNumber, timstamp, primaryScore, secondaryScore, shotNbr, programNumber);
                break;

            case 3:
                message = _messageFactory.MakeShotMessage(shooterId, laneId, laneNumber, timstamp, primaryScore, secondaryScore, shotNbr, programNumber);
                break;
            }
            return(message);
        }
Ejemplo n.º 3
0
        public SiusDataMessage Parse(RawMessage rawMessage)
        {
            if (!rawMessage.IsResponsible(Identifier, ValueCount))
            {
                return(null);
            }

            string[] valueList = rawMessage.Values.ToArray();

            SuccessHelper allOverSuccess = new SuccessHelper();
            int           laneId         = ValueAccessHelper.GetInt(valueList, LaneId, allOverSuccess);
            int           laneNbr        = ValueAccessHelper.GetInt(valueList, LaneNbr, allOverSuccess);
            int           shooterId      = ValueAccessHelper.GetInt(valueList, ShooterId, allOverSuccess);
            int           primaryScore   = ValueAccessHelper.GetInt(valueList, PrimaryScore, allOverSuccess);
            int           secondaryScore = ValueAccessHelper.GetInt(valueList, SecondaryScore, allOverSuccess);
            DateTime      timestamp      = ValueAccessHelper.GetDateTime(valueList, Timestamp, allOverSuccess);

            if (!allOverSuccess.Success)
            {
                return(null);
            }
            return(_messageFactory.MakeTotalMessage(shooterId, laneId, timestamp, primaryScore, secondaryScore));
        }