예제 #1
0
파일: BinaryNode.cs 프로젝트: TonusV/RNES
        /// <summary>
        /// Clones the curent node.
        /// </summary>
        /// <param name="model">the model in which the clone should be put</param>
        /// <returns>A new <see cref="BinaryNode"/> instance containing the clone</returns>
        public BinaryNode Clone(BinaryModel model)
        {
            var clone = new BinaryNode(model, Id)
            {
                Name      = Name,
                Protected = Protected,
                State     = State
            };

            return(clone);
        }
예제 #2
0
파일: BinaryEdge.cs 프로젝트: TonusV/RNES
        /// <summary>
        /// Clones the curent edge.
        /// </summary>
        /// <param name="model">the model in which the clone should be put</param>
        /// <returns>A new <see cref="BinaryEdge"/> instance containing the clone</returns>
        public BinaryEdge Clone(BinaryModel model)
        {
            var clone = new BinaryEdge(model, Id, Type)
            {
                Input  = model.Nodes.First(n => n.Id.Equals(Input.Id)),
                Output = model.Nodes.First(n => n.Id.Equals(Output.Id)),
                State  = State
            };

            return(clone);
        }
예제 #3
0
파일: BinaryModel.cs 프로젝트: TonusV/RNES
        /// <summary>
        /// Clones the current model
        /// </summary>
        /// <returns>A new <see cref="BinaryModel"/> instance containing the clone</returns>
        public BinaryModel Clone()
        {
            var clonedModel = new BinaryModel();

            foreach (var binaryNode in Nodes)
            {
                clonedModel.Nodes.Add(binaryNode.Clone(clonedModel));
            }
            foreach (var binaryEdge in Edges)
            {
                clonedModel.Edges.Add(binaryEdge.Clone(clonedModel));
            }
            return(clonedModel);
        }
예제 #4
0
파일: BinaryEntity.cs 프로젝트: TonusV/RNES
 /// <summary>
 /// protected constructor
 /// </summary>
 /// <param name="model">The parent model</param>
 /// <param name="id">The entity Id</param>
 protected BinaryEntity(BinaryModel model, string id)
 {
     Model = model;
     Id    = id;
     State = State.Unset;
 }
예제 #5
0
파일: BinaryNode.cs 프로젝트: TonusV/RNES
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="model">The parent model</param>
 /// <param name="id">The node id</param>
 public BinaryNode(BinaryModel model, string id) : base(model, id)
 {
 }
예제 #6
0
파일: BinaryEdge.cs 프로젝트: TonusV/RNES
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="model">The parent model</param>
 /// <param name="id">The edge Id</param>
 /// <param name="type">The edge type</param>
 public BinaryEdge(BinaryModel model, string id, EdgeType type) : base(model, id)
 {
     Type = type;
 }