private void ParseTowns(FileLoader loader, FileLoaderNode otbNode) { var nodeTown = otbNode.Child; while (nodeTown != null) { PropertyReader props; if (!loader.GetProps(nodeTown, out props)) throw new Exception("Could not read town data."); uint townid = props.ReadUInt32(); string townName = props.GetString(); ushort townTempleX = props.ReadUInt16(); ushort townTempleY = props.ReadUInt16(); byte townTempleZ = props.ReadByte(); var town = new Town(townid, townName, new Position(townTempleX, townTempleY, townTempleZ)); AddTown(town); nodeTown = nodeTown.Next; } }
public void AddTown(Town town) { _towns.Add(town); }