Skip to content

Commit

Permalink
Type Safe Default Postponed Refs (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBColton committed Feb 24, 2020
1 parent 99abe05 commit f088eec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions org/lateralgm/file/GMXFileReader.java
Expand Up @@ -1061,7 +1061,7 @@ private static void readGmObject(ProjectFileContext c, ResNode node, Node cNode)
final String sprname = objdoc.getElementsByTagName("spriteName").item(0).getTextContent(); //$NON-NLS-1$
if (!sprname.equals("<undefined>"))
{
postpone.add(new DefaultPostponedRef(f.resMap.getList(Sprite.class), obj.properties, PGmObject.SPRITE, sprname));
postpone.add(new DefaultPostponedRef<>(f.resMap.getList(Sprite.class), obj.properties, PGmObject.SPRITE, sprname));
}
else
{
Expand All @@ -1071,7 +1071,7 @@ private static void readGmObject(ProjectFileContext c, ResNode node, Node cNode)
final String mskname = objdoc.getElementsByTagName("maskName").item(0).getTextContent(); //$NON-NLS-1$
if (!mskname.equals("<undefined>"))
{
postpone.add(new DefaultPostponedRef(f.resMap.getList(Sprite.class), obj.properties, PGmObject.MASK, mskname));
postpone.add(new DefaultPostponedRef<>(f.resMap.getList(Sprite.class), obj.properties, PGmObject.MASK, mskname));
}
else
{
Expand All @@ -1081,7 +1081,7 @@ private static void readGmObject(ProjectFileContext c, ResNode node, Node cNode)
final String parname = objdoc.getElementsByTagName("parentName").item(0).getTextContent(); //$NON-NLS-1$
if (!parname.equals("<undefined>") && !parname.equals("self"))
{
postpone.add(new DefaultPostponedRef(f.resMap.getList(GmObject.class), obj.properties, PGmObject.PARENT, parname));
postpone.add(new DefaultPostponedRef<>(f.resMap.getList(GmObject.class), obj.properties, PGmObject.PARENT, parname));
}
else
{
Expand Down Expand Up @@ -1358,7 +1358,7 @@ else if (pname.equals("backgrounds")) //$NON-NLS-1$
Integer.parseInt(bnode.getAttributes().getNamedItem("visible").getTextContent()) != 0); //$NON-NLS-1$
final String bkgname = bnode.getAttributes().getNamedItem("name").getTextContent(); //$NON-NLS-1$

postpone.add(new DefaultPostponedRef(f.resMap.getList(Background.class), bkg.properties, PBackgroundDef.BACKGROUND, bkgname));
postpone.add(new DefaultPostponedRef<>(f.resMap.getList(Background.class), bkg.properties, PBackgroundDef.BACKGROUND, bkgname));

bkg.properties.put(
PBackgroundDef.FOREGROUND,
Expand Down Expand Up @@ -1403,7 +1403,7 @@ else if (pname.equals("views")) //$NON-NLS-1$
Integer.parseInt(vnode.getAttributes().getNamedItem("visible").getTextContent()) != 0); //$NON-NLS-1$
final String objname = vnode.getAttributes().getNamedItem("objName").getTextContent(); //$NON-NLS-1$

postpone.add(new DefaultPostponedRef(f.resMap.getList(GmObject.class), vw.properties, PView.OBJECT, objname));
postpone.add(new DefaultPostponedRef<>(f.resMap.getList(GmObject.class), vw.properties, PView.OBJECT, objname));

vw.properties.put(PView.SPEED_H,
Integer.parseInt(vnode.getAttributes().getNamedItem("hspeed").getTextContent())); //$NON-NLS-1$
Expand Down Expand Up @@ -1516,7 +1516,7 @@ else if (pname.equals("tiles")) //$NON-NLS-1$
Integer.parseInt(attribs.getNamedItem("y").getTextContent()))); //$NON-NLS-1$

final String bkgname = tnode.getAttributes().getNamedItem("bgName").getTextContent(); //$NON-NLS-1$
postpone.add(new DefaultPostponedRef(f.resMap.getList(Background.class), tile.properties, PTile.BACKGROUND, bkgname));
postpone.add(new DefaultPostponedRef<>(f.resMap.getList(Background.class), tile.properties, PTile.BACKGROUND, bkgname));

tile.properties.put(PTile.NAME, attribs.getNamedItem("name").getNodeValue()); //$NON-NLS-1$

Expand Down
2 changes: 1 addition & 1 deletion org/lateralgm/main/LGM.java
Expand Up @@ -135,7 +135,7 @@

public final class LGM
{
public static final String version = "1.8.102"; //$NON-NLS-1$
public static final String version = "1.8.103"; //$NON-NLS-1$

// TODO: This list holds the class loader for any loaded plugins which should be
// cleaned up and closed when the application closes.
Expand Down

0 comments on commit f088eec

Please sign in to comment.