示例#1
0
        private ActionObject GetActionObject(List <string> array, StreamReader reader)
        {
            string            name   = array[0];
            int               numcon = Convert.ToInt32(array[1]);
            string            line;
            int               numreq;
            ConToken          ctoken;
            List <ClearToken> tokens  = new List <ClearToken>();
            List <ConToken>   ctokens = new List <ConToken>();

            //make action line
            line = reader.ReadLine();
            ConToken utoken = new ConToken(line);

            ctokens.Add(utoken);
            numreq = Convert.ToInt32(reader.ReadLine());
            for (int j = 0; j < numreq; j++)
            {
                tokens.Add(new ClearToken(reader.ReadLine()));
            }
            ConLine cline = new ConLine(new ActionUse(_player.UseArtifact), utoken, tokens);

            //make move/place lines
            for (int i = 0; i < numcon - 1; i++)
            {
                ctoken = new ConToken(reader.ReadLine());
                ctokens.Add(ctoken);
            }
            ActionObject obj = new ActionObject(name, cline);

            obj.SetTokens(ctokens);
            return(obj);
        }
示例#2
0
 public ConLine(ActionUse usefunc, ConToken preset) : base(usefunc)
 {
     _preset = preset;
 }
示例#3
0
 //constructors
 public ConLine(ActionVoid voidfunc, ConToken preset) : base(voidfunc)
 {
     _preset = preset;
 }