Entitas.Context.ReplaceUser C# (CSharp) Method

ReplaceUser() public method

public ReplaceUser ( System newTimestamp, bool newIsLoggedIn ) : Entity
newTimestamp System
newIsLoggedIn bool
return Entity
        public Entity ReplaceUser(System.DateTime newTimestamp, bool newIsLoggedIn)
        {
            var entity = userEntity;
            if(entity == null) {
                entity = SetUser(newTimestamp, newIsLoggedIn);
            } else {
                entity.ReplaceUser(newTimestamp, newIsLoggedIn);
            }

            return entity;
        }

Same methods

Context::ReplaceUser ( string newName, int newAge ) : Entity

Usage Example

Exemplo n.º 1
0
        #pragma warning disable
        static void userComponent(Context context, UserComponent component) {
            var e = context.userEntity;
            var name = context.user.name;
            var has = context.hasUser;

            context.SetUser("John", 42);
            context.ReplaceUser("Max", 24);
            context.RemoveUser();
        }