public void AddMaterial(LevelMaterial material) { Assure.NotNull(material); lock (instanceMutationLock) { this.materials.Add(material); materialsOutOfDate = true; } }
public void DeleteMaterial(LevelMaterial material) { Assure.NotNull(geometry); lock (instanceMutationLock) { Assure.True(this.materials.Contains(material)); levelGeometryEntities.RemoveWhere(e => e.Material == material); this.materials.Remove(material); } }
public void ReplaceMaterial(LevelMaterial existing, LevelMaterial replacement) { Assure.NotNull(existing); Assure.NotNull(replacement); lock (instanceMutationLock) { Assure.True(this.materials.Contains(existing)); levelGeometryEntities.Where(e => e.Material == existing).ForEach(e => e.Material = replacement); this.materials.Replace(existing, replacement); materialsOutOfDate = true; } }
public LevelGeometryEntity(LevelDescription parentLevel, string tag, LevelGeometry geom, LevelMaterial mat, int id, LevelEntityMovementStep movementStep = null) { Tag = tag; geomID = geom.ID; matID = mat.ID; ID = id; this.ParentLevel = parentLevel; AddMovementStep(movementStep ?? new LevelEntityMovementStep(Transform.DEFAULT_TRANSFORM, 0f, false)); alternatingMovementDirection = false; initialDelay = 0f; texPan = Vector2.ZERO; }
public Material GetLoadedMaterialForLevelMaterial(LevelMaterial levelMat) { lock (instanceMutationLock) { return(currentMaterials[levelMat]); } }