Пример #1
0
 /// <summary>
 /// Clone an instance.
 /// </summary>
 public BoctMaterial(BoctMaterial mat)
 {
     GUID      = mat.GUID;
     LUID      = mat.LUID;
     Color     = mat.Color;
     SortOrder = mat.SortOrder;
     BoctCount = mat.BoctCount;
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public BoctMaterial GetSameColorMaterial(BoctMaterial mat)
 {
     foreach (var kv in _materials)
     {
         var m = kv.Value;
         if (m.Color.Equals(mat.Color))
         {
             return(m);
         }
     }
     return(null);
 }
Пример #5
0
 public BoctMaterial AddMaterial(BoctMaterial mat)
 {
     _materials.Add(mat.LUID, mat);
     return(mat);
 }