public void ReplaceLoginCMD(SkynetClient.AuthPackage newCmd) { var index = InputComponentsLookup.LoginCMD; var component = (LoginCMD)CreateComponent(index, typeof(LoginCMD)); component.cmd = newCmd; ReplaceComponent(index, component); }
public InputEntity SetLoginCMD(SkynetClient.AuthPackage newCmd) { if (hasLoginCMD) { throw new Entitas.EntitasException("Could not set LoginCMD!\n" + this + " already has an entity with LoginCMD!", "You should check if the context already has a loginCMDEntity before setting it or use context.ReplaceLoginCMD()."); } var entity = CreateEntity(); entity.AddLoginCMD(newCmd); return(entity); }
public void ReplaceLoginCMD(SkynetClient.AuthPackage newCmd) { var entity = loginCMDEntity; if (entity == null) { entity = SetLoginCMD(newCmd); } else { entity.ReplaceLoginCMD(newCmd); } }