Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison API/Factories/Xml/WarFoundryXmlFactory.cs @ 377:c3b0b28bad48
Re #353: Handle unloaded units being referenced outside factory
* Create interface for race factories
* Start to pull out common methods and add "try unit and fall back to factory" method for getting unit types
* Make XML Race Factory implement interface
* Use new factory
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 04 Jul 2011 20:02:26 +0000 |
parents | 1a70ca80ef41 |
children | ff7f1b319b4e |
comparison
equal
deleted
inserted
replaced
376:e50682387d63 | 377:c3b0b28bad48 |
---|---|
137 | 137 |
138 protected override Race CreateRaceFromStream (ZipFile file, Stream dataStream) | 138 protected override Race CreateRaceFromStream (ZipFile file, Stream dataStream) |
139 { | 139 { |
140 XmlElement elem = GetRootElementFromStream(dataStream, WarFoundryXmlElementName.RACE_ELEMENT); | 140 XmlElement elem = GetRootElementFromStream(dataStream, WarFoundryXmlElementName.RACE_ELEMENT); |
141 LogNotifier.Debug(GetType(), "Create Race"); | 141 LogNotifier.Debug(GetType(), "Create Race"); |
142 return raceFactory.CreateRaceFromElement(file, elem); | 142 return raceFactory.CreateRaceFromElement(elem); |
143 } | 143 } |
144 | 144 |
145 protected override void CleanUpFileAsSupportedType(ZipFile typedFile) | 145 protected override void CleanUpFileAsSupportedType(ZipFile typedFile) |
146 { | 146 { |
147 typedFile.Close(); | 147 typedFile.Close(); |