public void ProcessMemoryFunction(MemoryFunc mFunc, double augend) { switch (mFunc) { case MemoryFunc.MC: ClearMemory(); break; case MemoryFunc.M_ADD: AddToMemory(augend); break; case MemoryFunc.M_SUBTRACT: SubtractFromMemory(augend); break; case MemoryFunc.MR: ReturnFromMemory(); break; case MemoryFunc.MS: SaveToMemory(augend); break; default: ThrowMemoryException(); break; } }
public void Init(long[] values, TriggerManger.TriggerDefine td) { triggerDefine = td; name = td.NAME; for (int i = 0; i < td.argDefines.Count; i++) { Arg arg = new Arg(mapData); arg.IsInit = false; arg.argDefine = td.argDefines[i]; arg.ARGTYPE = td.argDefines[i].argtype; long value = values[td.argDefines[i].pos]; switch (arg.ARGTYPE) { case TriggerManger.ArgType.WAV: case TriggerManger.ArgType.STRING: arg.STRING = new StringData(mapData, (int)value); break; case TriggerManger.ArgType.LOCATION: arg.LOCATION = mapData.LocationDatas.SingleOrDefault((x) => x.INDEX == (int)value); if (arg.LOCATION == null) { LocationData locationData = new LocationData(mapData.mapEditor); locationData.INDEX = (int)value; locationData.STRING.String = "자동생성 로케이션 " + value; mapData.LocationDatas.Add(locationData); arg.LOCATION = locationData; } break; case TriggerManger.ArgType.UPRP: arg.UPRP = mapData.UPRP[value - 1]; break; default: arg.VALUE = value; break; } args.Add(arg); } if (name == "SetDeaths") { MemoryFunc.ApplyMemoryFunc(this); } else if (name == "Deaths") { MemoryFunc.ApplyMemoryFunc(this); } }
private void BMemory_Click(object sender, RoutedEventArgs e) { Button b = sender as Button; if (b == null) { return; } double current = model.GetAddend(); MemoryFunc mFunc = (MemoryFunc)memoryFunctions.IndexOf(b); model.ProcessMemoryFunction(mFunc, current); if (mFunc == MemoryFunc.MR) { DisplayNumberFormatted(model.GetAddendString()); } SetPrevButton(b); }
public void ProcessMemoryFunction(MemoryFunc mFunc, double augend) { memoryFunctions.ProcessMemoryFunction(mFunc, augend); }
public void CodeText(StringBuilder sb) { if (!IsEnable) { sb.Append("Disabled("); } if (!IsTrigger & IsAction) { sb.Append("Briefing"); } if (name == "SetDeaths") { sb.Append(MemoryFunc.GetTEPDeathText(this)); if (!IsEnable) { sb.Append(")"); } return; } else if (name == "Deaths") { sb.Append(MemoryFunc.GetTEPDeathText(this)); if (!IsEnable) { sb.Append(")"); } return; } else if (name == "SetMemory") { sb.Append(MemoryFunc.GetTEPMemoryText(this)); if (!IsEnable) { sb.Append(")"); } return; } else if (name == "Memory") { sb.Append(MemoryFunc.GetTEPMemoryText(this)); if (!IsEnable) { sb.Append(")"); } return; } { sb.Append(name + "("); for (int i = 0; i < args.Count; i++) { if (i != 0) { sb.Append(", "); } sb.Append(args[i].GetCode); } if (!IsEnable) { sb.Append(")"); } sb.Append(")"); } }