Exemplo n.º 1
0
    private void FileOpen(string pPath, List <Eve> pArrayEve)
    {
        string[]  arrStr = System.IO.File.ReadAllLines(@PATH);
        string[]  strArray;
        Eve       tempEvent;
        Condition tempCond;
        Action    tempAct;
        Sheath    tempSth;
        Boolean   tempBool;
        String    line;

        Debug.Log("Contents of WriteLines2.txt = ");
        for (int i = 0; i < arrStr.Length; i += 2)
        {
            line = arrStr[i];
            // Use a tab to indent each line of the file.
            Debug.Log("\t" + line);
            strArray = line.Split(' ');
            if (strArray[0] == "true")
            {
                tempBool = true;
            }
            else
            {
                tempBool = false;
            }

            tempCond  = new Condition(tempBool, float.Parse(strArray[POSITION_PROPERTY]));
            tempSth   = new Sheath(strArray[POSITION_NAME], arrStr[i + 1]);
            tempEvent = new Eve(tempCond, null, tempSth);
            arrayEve.Add(tempEvent);
        }
    }
 public void SetSheath(Sheath sheath)
 {
     this.sheath = sheath;
 }
Exemplo n.º 3
0
 public Eve(Condition pCond, Action pAct, Sheath pSth)
 {
     cond = pCond;
     act  = pAct;
     sth  = pSth;
 }