Resource.pkg 832 B

1234567891011121314151617181920212223242526272829
  1. $#include "Resource/Resource.h"
  2. class Resource
  3. {
  4. bool Load(Deserializer& source);
  5. bool Save(Serializer& dest) const;
  6. tolua_outside bool ResourceLoad @ Load(const String& fileName);
  7. tolua_outside bool ResourceSave @ Save(const String& fileName) const;
  8. const String GetName() const;
  9. StringHash GetNameHash() const;
  10. unsigned GetMemoryUse() const;
  11. tolua_readonly tolua_property__get_set String name;
  12. tolua_readonly tolua_property__get_set StringHash nameHash;
  13. tolua_readonly tolua_property__get_set unsigned memoryUse;
  14. };
  15. ${
  16. static bool ResourceLoad(Resource* resource, const String& fileName)
  17. {
  18. return resource->LoadFile(fileName);
  19. }
  20. static bool ResourceSave(const Resource* resource, const String& fileName)
  21. {
  22. return resource->SaveFile(fileName);
  23. }
  24. $}