bloodcontainerbase.c 805 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. class BloodContainerBase extends ItemBase
  2. {
  3. private bool m_IsBloodTypeVisible = false;
  4. void BloodContainerBase()
  5. {
  6. RegisterNetSyncVariableBool("m_IsBloodTypeVisible");
  7. }
  8. override bool IsBloodContainer()
  9. {
  10. return true;
  11. }
  12. void SetBloodTypeVisible( bool visible )
  13. {
  14. m_IsBloodTypeVisible = visible;
  15. SetSynchDirty();
  16. }
  17. bool GetBloodTypeVisible()
  18. {
  19. return m_IsBloodTypeVisible;
  20. }
  21. override void OnStoreSave( ParamsWriteContext ctx )
  22. {
  23. super.OnStoreSave(ctx);
  24. ctx.Write( m_IsBloodTypeVisible );
  25. }
  26. override bool OnStoreLoad( ParamsReadContext ctx, int version )
  27. {
  28. if ( !super.OnStoreLoad(ctx, version) )
  29. return false;
  30. bool is_blood_type_visible = false;
  31. ctx.Read( is_blood_type_visible );
  32. SetBloodTypeVisible( is_blood_type_visible );
  33. return true;
  34. }
  35. }