예제 #1
0
        //Clone interface
        public object Clone()
        {
            var cloneRoad = new DividedRoadElement()
            {
                DividerFlags = this.DividerFlags,
                Value        = this.Value,
                DividerType  = this.DividerType,
                Textures     = new string[this.Textures.Length],
            };

            //clone arrays
            DividerTextures.CopyTo(cloneRoad.DividerTextures, 0);
            Textures.CopyTo(cloneRoad.Textures, 0);

            for (int i = 0; i < this.Vertices.Count; i++)
            {
                cloneRoad.Vertices.Add(this.Vertices[i].Clone());
            }

            return(cloneRoad);
        }