WwiseSharedLanguageId.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. #pragma once
  16. #include "Wwise/WwiseLanguageId.h"
  17. #include "Wwise/CookedData/WwiseLanguageCookedData.h"
  18. #include "WwiseSharedLanguageId.generated.h"
  19. USTRUCT(BlueprintType)
  20. struct WWISERESOURCELOADER_API FWwiseSharedLanguageId
  21. {
  22. GENERATED_BODY()
  23. static const FWwiseSharedLanguageId Sfx;
  24. TSharedPtr<FWwiseLanguageId> Language;
  25. UPROPERTY(BlueprintReadOnly, VisibleInstanceOnly, Category = "Wwise")
  26. EWwiseLanguageRequirement LanguageRequirement = EWwiseLanguageRequirement::SFX;
  27. FWwiseSharedLanguageId();
  28. FWwiseSharedLanguageId(int32 InLanguageId, const FName& InLanguageName, EWwiseLanguageRequirement InLanguageRequirement);
  29. FWwiseSharedLanguageId(const FWwiseLanguageId& InLanguageId, EWwiseLanguageRequirement InLanguageRequirement);
  30. ~FWwiseSharedLanguageId();
  31. int32 GetLanguageId() const
  32. {
  33. return Language->LanguageId;
  34. }
  35. const FName& GetLanguageName() const
  36. {
  37. return Language->LanguageName;
  38. }
  39. bool operator==(const FWwiseSharedLanguageId& Rhs) const
  40. {
  41. return (!Language.IsValid() && !Rhs.Language.IsValid())
  42. || (Language.IsValid() && Rhs.Language.IsValid() && *Language == *Rhs.Language);
  43. }
  44. bool operator!=(const FWwiseSharedLanguageId& Rhs) const
  45. {
  46. return (Language.IsValid() != Rhs.Language.IsValid())
  47. || (Language.IsValid() && Rhs.Language.IsValid() && *Language != *Rhs.Language);
  48. }
  49. bool operator>=(const FWwiseSharedLanguageId& Rhs) const
  50. {
  51. return (!Language.IsValid() && !Rhs.Language.IsValid())
  52. || (Language.IsValid() && Rhs.Language.IsValid() && *Language >= *Rhs.Language);
  53. }
  54. bool operator>(const FWwiseSharedLanguageId& Rhs) const
  55. {
  56. return (Language.IsValid() && !Rhs.Language.IsValid())
  57. || (Language.IsValid() && Rhs.Language.IsValid() && *Language > *Rhs.Language);
  58. }
  59. bool operator<=(const FWwiseSharedLanguageId& Rhs) const
  60. {
  61. return (!Language.IsValid() && !Rhs.Language.IsValid())
  62. || (Language.IsValid() && Rhs.Language.IsValid() && *Language <= *Rhs.Language);
  63. }
  64. bool operator<(const FWwiseSharedLanguageId& Rhs) const
  65. {
  66. return (!Language.IsValid() && Rhs.Language.IsValid())
  67. || (Language.IsValid() && Rhs.Language.IsValid() && *Language < *Rhs.Language);
  68. }
  69. };
  70. inline uint32 GetTypeHash(const FWwiseSharedLanguageId& Id)
  71. {
  72. return GetTypeHash(Id.Language->LanguageId);
  73. }