/// <summary> /// Clone an instance. /// </summary> public BoctMaterial(BoctMaterial mat) { GUID = mat.GUID; LUID = mat.LUID; Color = mat.Color; SortOrder = mat.SortOrder; BoctCount = mat.BoctCount; }
public BoctMaterial AddNewMaterial(BoctMaterial mat) { var newMaterial = new BoctMaterial(mat); newMaterial.GUID = Guid.NewGuid(); newMaterial.LUID = _materials.GetHighestKey <BoctMaterial>() + 1; _materials.Add(newMaterial.LUID, newMaterial); return(newMaterial); }
public BoctMaterial AddMaterial() { var mat = new BoctMaterial(); mat.GUID = Guid.NewGuid(); mat.LUID = _materials.GetHighestKey <BoctMaterial>() + 1; mat.Color = BoctMaterial.DefaultColor; mat.ColorChanged = true; _materials.Add(mat.LUID, mat); return(mat); }
public BoctMaterial GetSameColorMaterial(BoctMaterial mat) { foreach (var kv in _materials) { var m = kv.Value; if (m.Color.Equals(mat.Color)) { return(m); } } return(null); }
public BoctMaterial AddMaterial(BoctMaterial mat) { _materials.Add(mat.LUID, mat); return(mat); }