Exemplo n.º 1
0
            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);
            }
Exemplo n.º 2
0
        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;
                }
            }
        }