public AttackInfo( Weapon _w, int _dmg, SpaceObject _src ) { Weapon = _w; Damage = _dmg; Source = _src; }
public static Item Spawn( World _world, ItemTemplate _template ) { Item _i = new Item(_template.Name, _world); _i.ID = _template.ID; _i.Texture = _template.Texture; _i.Tags = new List<string>(_template.Tags); if (_template.Weapon != null) { Weapon _w = new Weapon( _template.Name, _template.ID); _w.Damage = _template.Weapon.Damage; _w.Frequency = _template.Weapon.Frequency; _w.BeamThickness = _template.Weapon.BeamThickness; _w.Range = _template.Weapon.Range; if(Utility.SumColour(_template.Weapon.BeamTint) != 0) _w.BeamTint = _template.Weapon.BeamTint; _w.Item = _i; _i.Component = _w; _i.Component.Item = _i; //reference upwards for the component } return _i; }