Quick smattering of type safety to go along with other misc cleanup I've
got in progress over in yohoho. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@395 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -411,7 +411,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
|
|||||||
* Don't call this method! This is only public so that the scene
|
* Don't call this method! This is only public so that the scene
|
||||||
* writer can generate XML from the raw scene data.
|
* writer can generate XML from the raw scene data.
|
||||||
*/
|
*/
|
||||||
public Iterator getSections ()
|
public Iterator<Section> getSections ()
|
||||||
{
|
{
|
||||||
return _sections.values().iterator();
|
return _sections.values().iterator();
|
||||||
}
|
}
|
||||||
@@ -438,7 +438,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
|
|||||||
protected final Section getSection (int x, int y, boolean create)
|
protected final Section getSection (int x, int y, boolean create)
|
||||||
{
|
{
|
||||||
int key = key(x, y);
|
int key = key(x, y);
|
||||||
Section sect = (Section)_sections.get(key);
|
Section sect = _sections.get(key);
|
||||||
if (sect == null && create) {
|
if (sect == null && create) {
|
||||||
short sx = (short)(MathUtil.floorDiv(x, swidth)*swidth);
|
short sx = (short)(MathUtil.floorDiv(x, swidth)*swidth);
|
||||||
short sy = (short)(MathUtil.floorDiv(y, sheight)*sheight);
|
short sy = (short)(MathUtil.floorDiv(y, sheight)*sheight);
|
||||||
@@ -452,14 +452,14 @@ public class SparseMisoSceneModel extends MisoSceneModel
|
|||||||
public Object clone ()
|
public Object clone ()
|
||||||
{
|
{
|
||||||
SparseMisoSceneModel model = (SparseMisoSceneModel)super.clone();
|
SparseMisoSceneModel model = (SparseMisoSceneModel)super.clone();
|
||||||
model._sections = new StreamableHashIntMap();
|
model._sections = new StreamableHashIntMap<Section>();
|
||||||
for (Iterator iter = getSections(); iter.hasNext(); ) {
|
for (Iterator<Section> iter = getSections(); iter.hasNext(); ) {
|
||||||
Section sect = (Section)iter.next();
|
Section sect = iter.next();
|
||||||
model.setSection((Section)sect.clone());
|
model.setSection((Section)sect.clone());
|
||||||
}
|
}
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Contains our sections in row major order. */
|
/** Contains our sections in row major order. */
|
||||||
protected StreamableHashIntMap _sections = new StreamableHashIntMap();
|
protected StreamableHashIntMap<Section> _sections = new StreamableHashIntMap<Section>();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user