New equipment

As it seems everyone is putting their new-* branches out there for the world to see, I thought I'd do the same.

This is work in progress. I have a working implementation on the Lua side of things, but the C++ is still very unaware of it and considers that you fly on bare metal most of the time. Also, it doesn't get saved yet due to me still having to look at the serialize code.

The API is quite straigthforward : on the Lua side the method names are the same, the argument order should be the same, etc etc... On the C++ side, every bit of information that is not UI related should be obtained via GetModifier calls. I've also built an infrastructure for random junk in case integers don't suffice, but the more I progress the more I think that if I need it I'm doing something wrong.

Critics are welcome, patches even more :-)
hmm, no, not really. I'd need my computer to look at it, but those methods
go into the LaserType table, which should NOT get serialized.


On Mon, Jun 9, 2014 at 11:10 PM, tramsch <notifications@github.com> wrote:

> In data/libs/Equipment.lua:
>
> > +	return 1
> > +end
> > +
> > +function LaserType:Uninstall(ship, num, slot)
> > +	if __ApplyCapabilities(ship, self.capabilities, 1, -1) < 1 then return 0 end
> > +	local prefix = "front_"
> > +	if slot == "laser_rear" then prefix = "_rear" end
> > +	for k,v in pairs(self.laser_stats) do
> > +		ship:setprop(prefix..k, nil)
> > +	end
> > +end
> > +
> > +-- Single drive type, no support for slave drives.
> > +HyperdriveType = utils.inherits(EquipType, "HyperdriveType")
> > +
> > +HyperdriveType.GetMaximumRange = function (self, ship)
>
> aren't these the functions that get put into "equipment" later on and then
> into the return value of the serialization function?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pioneerspacesim/pioneer/pull/1719/files#r13565055>.
>