Entitas.Context.SetOtherContext C# (CSharp) Method

SetOtherContext() public method

public SetOtherContext ( System newTimestamp, bool newIsLoggedIn ) : Entity
newTimestamp System
newIsLoggedIn bool
return Entity
        public Entity SetOtherContext(System.DateTime newTimestamp, bool newIsLoggedIn)
        {
            if(hasOtherContext) {
                throw new EntitasException("Could not set otherContext!\n" + this + " already has an entity with OtherContextComponent!",
                    "You should check if the context already has a otherContextEntity before setting it or use context.ReplaceOtherContext().");
            }
            var entity = CreateEntity();
            entity.AddOtherContext(newTimestamp, newIsLoggedIn);
            return entity;
        }