protected internal override StoryEvent MakeOutcome(bool gain) { SetValueEvent e = new SetValueEvent(); ResourceValue rv = new ResourceValue(); rv.resource = resource; e.value = rv; e.amount = amount * (gain ? 1 : -1); e.operation = SetValueEvent.Operation.Change; return(e); }
public override void AddFields(FieldData fields) { base.AddFields(fields); value = fields.add(value, "gameValue"); operation = fields.addEnum(operation, "operation"); amount = fields.add(amount, "value"); if (fields.readMode()) { Resource resource = fields.addEnum(default(Resource), "resource"); if (resource != default(Resource)) { ResourceValue rv = new ResourceValue(); rv.resource = resource; value = rv; } } }