static void Main(string[] args) { DigitalLock _lock = new DigitalLock(5); PickLock pickLock = new PickLock(); Console.WriteLine("Bulunan Şifre : " + pickLock.Unlock(_lock)); Console.ReadKey(); }
/// <summary> /// Saves the door definition /// </summary> /// <param name="writer">XML writer handle</param> /// <returns></returns> public override bool Save(XmlWriter writer) { if (writer == null) { return(false); } // State writer.WriteStartElement(Tag); writer.WriteAttributeString("type", Type.ToString()); writer.WriteAttributeString("state", State.ToString()); writer.WriteAttributeString("isbreakable", IsBreakable.ToString()); writer.WriteAttributeString("hasbutton", HasButton.ToString()); writer.WriteAttributeString("picklock", PickLock.ToString()); writer.WriteAttributeString("speed", Speed.TotalSeconds.ToString()); writer.WriteAttributeString("strength", Strength.ToString()); writer.WriteAttributeString("smallitempassthrough", SmallItemPassThrough.ToString()); base.Save(writer); writer.WriteEndElement(); return(true); }