25 #include "textlines.h"
29 #include "command_line.h"
31 void command_linest::init(const string
&str
)
35 //BUILD THE TOKEN LIST
37 while(grab_arg(original
,pos
));
41 for(l
=0;l
<arg_vect
.str
.size();l
++)
43 handle_arg(arg_vect
.str
[l
]->dat
);
47 char command_linest::grab_arg(string
&source
,long &pos
)
51 while(pos
<source
.length())
53 //HIT A NEW ARGUMENT? RETURN, OTHERWISE SKIP AND START UP
56 if(dest
.empty()){pos
++;continue;}
60 arg_vect
.add_string(dest
);
70 if(!dest
.empty())arg_vect
.add_string(dest
);
74 void command_linest::handle_arg(string
&arg
)
79 grab_token_string_pos(dest
,arg
,pos
,' ');
85 //KEEP GOING FOR A NUMBER
86 while(pos
+1<arg
.length())
90 auto s
=arg
.begin(),e
=arg
.end();
102 else if((*s
)==' '&&!quote
)break;
110 if(arg_pos
==0)gen_id
=convert_string_to_long(dest
);
115 world_seed
=convert_string_to_ulong(dest
);