| package mechanique; | |
| /* | |
| MechaniQue, the programming language for Interactive Fiction | |
| Copyright (C) 2007 G.J.G.T. (Gabor) de Mooij | |
| This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation (highest version applies !!). | |
| This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | |
| You should have received a copy of the GNU General Public License along | |
| with this program; if not, write to the Free Software Foundation, Inc., | |
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| ---MECHANIQUESOFT/GABOR DE MOOIJ | |
| */ | |
| import java.io.*; | |
| import java.util.*; | |
| import java.util.regex.*; | |
| import java.applet.*; | |
| import java.io.Serializable; | |
| import java.lang.Math; | |
| ; | |
| public class ActionSay extends Action | |
| { | |
| private boolean shown = false; | |
| private String fill(String t) | |
| { | |
| Pattern p = Pattern.compile("%%(.*?)%%"); | |
| Matcher m = p.matcher(t); | |
| while (m.find()){ | |
| t = t.replaceAll("%%"+m.group(1)+"%%",new String(this.owner.getStory().getWallet().getQuantity(m.group(1)).toString())); | |
| } | |
| return t; | |
| } | |
| public void execute() | |
| { | |
| this.parameter = this.parameter.replaceAll("<br>",""); | |
| if (this.parameter.indexOf(";")==0) | |
| { | |
| if (!this.shown || this.owner.getStory().getWallet().has("_DESCRIBE_FULL")){ | |
| this.owner.getStory().getWallet().dropAll("ZERO"); | |
| this.owner.getStory().getDisplayUnit().print(this.fill(this.parameter.substring(1))); | |
| this.shown=true; | |
| } | |
| } else if (!this.parameter.equals("")) { | |
| this.owner.getStory().getDisplayUnit().print(this.fill(this.parameter)); | |
| } | |
| } | |
| } | |
Xet Storage Details
- Size:
- 2.22 kB
- Xet hash:
- 2ba0339c6cc1c6c7aa156bf066ecd089671b940c65e1779c4f5af5780f14c929
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.