Mirror of Svelto.ECS because we're a fan of it
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
-
- namespace Svelto.ECS.Experimental
- {
- [Serialization.DoNotSerialize]
- public struct ECSString:IEquatable<ECSString>
- {
- uint id;
-
- public ECSString(string newText)
- {
- id = ResourcesECSDB<string>.ToECS(newText);
- }
-
- public static implicit operator string(ECSString ecsString)
- {
- return ResourcesECSDB<string>.FromECS(ecsString.id);
- }
-
- public void Set(string newText)
- {
- if (id != 0)
- ResourcesECSDB<string>.resources(id) = newText;
- else
- id = ResourcesECSDB<string>.ToECS(newText);
- }
-
- public bool Equals(ECSString other)
- {
- return other.id == id;
- }
-
- public override string ToString()
- {
- return ResourcesECSDB<string>.FromECS(id);
- }
- }
- }
|