+void Interpreter::ReadIkari(Ikari &ikari, const PropertyList &props) {
+ for (PropertyList::ConstIterator i(props.Begin()), end(props.End()); i != end; ++i) {
+ if (i->first == "name") {
+ ikari.SetName(GetString(*i->second));
+ } else if (i->first == "cost") {
+ ikari.SetCost(GetNumber(*i->second));
+ } else if (i->first == "targets") {
+ ikari.GetTargetingMode() = *GetTargetingMode(*i->second);
+ } else if (i->first == "magical") {
+ if (GetBoolean(*i->second)) {
+ ikari.SetMagical();
+ }
+ } else if (i->first == "physical") {
+ if (GetBoolean(*i->second)) {
+ ikari.SetPhysical();
+ }
+ } else {
+ throw Error("unknown Ikari property: " + i->first);
+ }
+ }
+}
+
+void Interpreter::ReadItem(Item &item, const PropertyList &props) {
+ for (PropertyList::ConstIterator i(props.Begin()), end(props.End()); i != end; ++i) {
+ if (i->first == "name") {
+ item.SetName(GetString(*i->second));
+ } else if (i->first == "menuicon") {
+ item.SetMenuIcon(GetSprite(*i->second));
+ } else if (i->first == "battle") {
+ if (GetBoolean(*i->second)) {
+ item.SetUsableInBattle();
+ }
+ } else if (i->first == "targets") {
+ item.GetTargetingMode() = *GetTargetingMode(*i->second);
+ } else if (i->first == "ikari") {
+ item.SetIkari(GetIkari(*i->second));
+ } else if (i->first == "attackanimation") {
+ item.SetAttackAnimation(GetAnimation(*i->second));
+ } else {
+ throw Error("unknown Item property: " + i->first);
+ }
+ }
+}
+