/// <summary> /// Creates a SimpleUri for the given module:object combo /// </summary> /// <param name="moduleName"></param> /// <param name="objectName"></param> public SimpleUri(string moduleName, string objectName) { Contract.RequiresNotEmpty(moduleName, "moduleName"); Contract.RequiresNotEmpty(objectName, "objectName"); this.moduleName = moduleName; this.objectName = objectName; this.normalisedModuleName = UriUtil.normalise(moduleName); this.normalisedObjectName = UriUtil.normalise(objectName); }
/// <summary> /// Creates a SimpleUri from a string in the format "module:object". If the string does not match this format, it will be marked invalid /// </summary> /// <param name="simpleUri">module:object string</param> public SimpleUri(string simpleUri) { string[] split = simpleUri.Split(MODULE_SEPARATOR); if (split.Length == 1) { moduleName = split[0]; normalisedModuleName = UriUtil.normalise(split[0]); objectName = split[1]; normalisedObjectName = UriUtil.normalise(split[1]); } }
/// <summary> /// Creates a SimpleUri for the given module:object combo /// </summary> /// <param name="moduleName"></param> /// <param name="objectName"></param> public GameUri(string _moduleName, string _objectName) : this() { Contract.RequiresNotEmpty(moduleName, "moduleName"); Contract.RequiresNotEmpty(objectName, "objectName"); moduleName = _moduleName; objectName = _objectName; normalisedModuleName = UriUtil.normalise(_moduleName); normalisedObjectName = UriUtil.normalise(_objectName); normalisedName = normalisedModuleName + MODULE_SEPARATOR + normalisedObjectName; name = moduleName + MODULE_SEPARATOR + objectName; }
/// <summary> /// Creates a SimpleUri for the given module:object combo /// </summary> /// <param name="moduleName"></param> /// <param name="objectName"></param> public AssetUri(AssetType _type, string _moduleName, string _objectName) : this() { Contract.RequiresNotEmpty(_moduleName, "moduleName"); Contract.RequiresNotEmpty(_objectName, "objectName"); type = _type; moduleName = _moduleName; objectName = _objectName; normalisedModuleName = UriUtil.normalise(_moduleName); normalisedObjectName = UriUtil.normalise(_objectName); normalisedName = type.name + TYPE_SEPARATOR + normalisedModuleName + MODULE_SEPARATOR + normalisedObjectName; }
/// <summary> /// Creates a SimpleUri from a string in the format "module:object". If the string does not match this format, it will be marked invalid /// </summary> /// <param name="simpleUri">module:object string</param> public GameUri(string simpleUri) : this() { string[] split = simpleUri.Split(MODULE_SEPARATOR); if (split.Length == 2) { moduleName = split[0]; normalisedModuleName = UriUtil.normalise(split[0]); objectName = split[1]; normalisedObjectName = UriUtil.normalise(split[1]); normalisedName = normalisedModuleName + MODULE_SEPARATOR + normalisedObjectName; name = moduleName + MODULE_SEPARATOR + objectName; } }
/// <summary> /// Creates a SimpleUri from a string in the format "module:object". If the string does not match this format, it will be marked invalid /// </summary> /// <param name="simpleUri">module:object string</param> public AssetUri(string simpleUri) : this() { string[] split = simpleUri.Split(MODULE_SEPARATOR); if (split.Length == 3) { type = AssetType.find(split[0]); moduleName = split[1]; normalisedModuleName = UriUtil.normalise(split[1]); objectName = split[2]; normalisedObjectName = UriUtil.normalise(split[2]); normalisedName = type.name + TYPE_SEPARATOR + normalisedModuleName + MODULE_SEPARATOR + normalisedObjectName; name = type.name + TYPE_SEPARATOR + moduleName + MODULE_SEPARATOR + objectName; } }