character.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ########################################################################
  2. # Hello Worlds - Libre 3D RPG game.
  3. # Copyright (C) 2020 CYBERDEViL
  4. #
  5. # This file is part of Hello Worlds.
  6. #
  7. # Hello Worlds is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # Hello Worlds is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. #
  20. ########################################################################
  21. from core.db import Players, GenericSpawnData, CharacterData
  22. from core.models import PlayerStatsModel
  23. class Character:
  24. def __init__(self, characterData, spawnData):
  25. self._characterData = characterData
  26. self._spawnData = spawnData
  27. self._stats = PlayerStatsModel(self._characterData.stats)
  28. """ Expose dynamic attributes
  29. """
  30. @property
  31. def stats(self): return self._stats
  32. """ Expose CharacterData
  33. """
  34. @property
  35. def id(self): return self._characterData.id
  36. @property
  37. def name(self): return self._characterData.name
  38. @property
  39. def file(self): return self._characterData.file
  40. @property
  41. def speciesId(self): return self._characterData.speciesId
  42. """ Expose SpawnData
  43. """
  44. @property
  45. def spawnData(self): return self._spawnData