Esempio n. 1
0
 public override void ParseElement(XmlElement elem)
 {
     base.ParseElement(elem);
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_DURATION, ref duration);
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_RESPONSE_TIMELIMIT, ref responseTimeLimit);
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_GUESS_TIMELIMIT, ref guessTimeLimit);
 }
Esempio n. 2
0
 /// <summary>
 /// Parses Game specific variables for this Trial from the given XmlElement.
 /// If no parsable attributes are found, or fail, then it will generate some from the given GameData.
 /// Used when parsing a Trial that IS defined in the Session file.
 /// </summary>
 public virtual void ParseGameSpecificVars(XmlNode n, SessionData data)
 {
     XMLUtil.ParseAttribute(n, ATTRIBUTE_DELAY, ref delay);
     XMLUtil.ParseAttribute(n, ATTRIBUTE_POSX, ref positionX);
     XMLUtil.ParseAttribute(n, ATTRIBUTE_POSY, ref positionY);
     XMLUtil.ParseAttribute(n, ATTRIBUTE_IS_RED, ref isRed);
     XMLUtil.ParseAttribute(n, ATTRIBUTE_IS_RANDOM, ref isRandom);
 }
Esempio n. 3
0
 public void ParseElement(XmlElement elem)
 {
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_GAMETYPE, ref gameType);
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_SHUFFLE, ref shuffleTrials, true);
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_X_MIN, ref xMin, true);
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_X_MAX, ref xMax, true);
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_Y_MIN, ref yMin, true);
     XMLUtil.ParseAttribute(elem, ATTRIBUTE_Y_MAX, ref yMax, true);
 }
Esempio n. 4
0
    /// <summary>
    /// Parses Game specific variables for this Trial from the given XmlElement.
    /// If no parsable attributes are found, or fail, then it will generate some from the given GameData.
    /// Used when parsing a Trial that IS defined in the Session file.
    /// </summary>
    public override void ParseGameSpecificVars(XmlNode n, SessionData session)
    {
        base.ParseGameSpecificVars(n, session);

        ReactData data = (ReactData)(session.gameData);

        if (!XMLUtil.ParseAttribute(n, ReactData.ATTRIBUTE_DURATION, ref duration, true))
        {
            duration = data.GeneratedDuration;
        }
    }
    /// <summary>
    /// Parses Game specific variables for this Trial from the given XmlElement.
    /// If no parsable attributes are found, or fail, then it will generate some from the given GameData.
    /// Used when parsing a Trial that IS defined in the Session file.
    /// </summary>
    public override void ParseGameSpecificVars(XmlNode n, SessionData session)
    {
        base.ParseGameSpecificVars(n, session);

        ReactDataRed data = (ReactDataRed)(session.gameData);

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_DURATION, ref duration, true))
        {
            duration = data.GeneratedDuration;
        }

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_ISRED, ref isRed, true))
        {
            isRed = data.IsRed;
        }

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_ISRANDOMPOS, ref isRandomPos, true))
        {
            isRandomPos = data.IsRandomPos;
        }

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_MINX, ref minX, true))
        {
            minX = data.MinX;
        }

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_MAXX, ref maxX, true))
        {
            maxX = data.MaxX;
        }

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_MINY, ref minY, true))
        {
            minY = data.MinY;
        }

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_MAXY, ref maxY, true))
        {
            maxY = data.MaxY;
        }

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_FIXEDX, ref fixedX, true))
        {
            fixedX = data.FixedX;
        }

        if (!XMLUtil.ParseAttribute(n, ReactDataRed.ATTRIBUTE_FIXEDY, ref fixedY, true))
        {
            fixedX = data.FixedY;
        }
    }
Esempio n. 6
0
    /// <summary>
    /// Parses Game specific variables for this Trial from the given XmlElement.
    /// If no parsable attributes are found, or fail, then it will generate some from the given GameData.
    /// Used when parsing a Trial that IS defined in the Session file.
    /// </summary>
    public override void ParseGameSpecificVars(XmlNode n, SessionData session)
    {
        base.ParseGameSpecificVars(n, session);

        AzzaranoData data = (AzzaranoData)(session.gameData);

        if (!XMLUtil.ParseAttribute(n, AzzaranoData.ATTRIBUTE_DURATION, ref duration, true))
        {
            duration = data.GeneratedDuration;
        }

        XMLUtil.ParseAttribute(n, AzzaranoData.ATTRIBUTE_POSITION, ref position);
        XMLUtil.ParseAttribute(n, AzzaranoData.ATTRIBUTE_POSITIONX, ref positionX);
        XMLUtil.ParseAttribute(n, AzzaranoData.ATTRIBUTE_POSITIONY, ref positionY);
        XMLUtil.ParseAttribute(n, AzzaranoData.ATTRIBUTE_RED, ref red, true);
    }
Esempio n. 7
0
    /// <summary>
    /// Parses Game specific variables for this Trial from the given XmlElement.
    /// If no parsable attributes are found, or fail, then it will generate some from the given GameData.
    /// Used when parsing a Trial that IS defined in the Session file.
    /// </summary>
    public virtual void ParseGameSpecificVars(XmlNode n, SessionData data)
    {
        XMLUtil.ParseAttribute(n, ATTRIBUTE_DELAY, ref delay);
        XMLUtil.ParseAttribute(n, ATTRIBUTE_IS_RED, ref isRed, true);
        string position = "";

        if (XMLUtil.ParseAttribute(n, ATTRIBUTE_POSITION, ref position, true))
        {
            if (position == "random")
            {
                x = Random.Range(data.xMin, data.xMax);
                y = Random.Range(data.yMin, data.yMax);
            }
            else
            {
                string[] xy = position.Split(' ');
                x = float.Parse(xy[0]);
                y = float.Parse(xy[1]);
            }
        }
    }
 /// <summary>
 /// Parses Game specific variables for this Trial from the given XmlElement.
 /// If no parsable attributes are found, or fail, then it will generate some from the given GameData.
 /// Used when parsing a Trial that IS defined in the Session file.
 /// </summary>
 public virtual void ParseGameSpecificVars(XmlNode n, SessionData data)
 {
     XMLUtil.ParseAttribute(n, ATTRIBUTE_DELAY, ref delay);
 }
Esempio n. 9
0
 public override void ParseElement(XmlElement elem)
 {
     base.ParseElement(elem);
     XMLUtil.ParseAttribute(elem, HORIZONTAL_SCALE, ref horizontalScale);
     XMLUtil.ParseAttribute(elem, MARKER_SPEED, ref markerSpeed);
 }
Esempio n. 10
0
 /// <summary>
 /// Parses Game specific variables for this Trial from the given XmlElement.
 /// If no parsable attributes are found, or fail, then it will generate some from the given GameData.
 /// Used when parsing a Trial that IS defined in the Session file.
 /// </summary>
 public virtual void ParseGameSpecificVars(XmlNode n, SessionData data)
 {
     XMLUtil.ParseAttribute(n, ATTRIBUTE_DELAY, ref delay);
     XMLUtil.ParseAttribute(n, ATTRIBUTE_ISRED, ref isRed);
     XMLUtil.ParseAttribute(n, ATTRIBUTE_RANDOMPOSITION, ref isRandomPosition);
 }