Esempio n. 1
0
        public static void SerializeToXml(CombatState state)
        {
            // Setup extend serializer
            var serializer = new ConfigurationContainer()
                             .EnableImplicitTypingFromNested <CombatState>()
                             .Create();

            // XML Writer
            var writer = XmlWriter.Create(state.Name + "_" + state.CurrentRound + ".xml");

            // Serialize
            serializer.Serialize(writer, state);

            // Finalize
            writer.Flush();
            writer.Dispose();
        }
 public CombatStateTracker(string path)
 {
     State = CombatStateSerializer.DeserializeFromXml(path);
 }
 public CombatStateTracker(CombatState state)
 {
     State = state;
 }