Author: jquelin
Date: Wed Oct  3 10:14:24 2007
New Revision: 21794

Modified:
   branches/pdd15oo/examples/sdl/minesweeper/eventhandler.pir
   branches/pdd15oo/examples/sdl/minesweeper/field.pir
   branches/pdd15oo/examples/sdl/minesweeper/mines.pir

Log:
more find_type removal

Modified: branches/pdd15oo/examples/sdl/minesweeper/eventhandler.pir
==============================================================================
--- branches/pdd15oo/examples/sdl/minesweeper/eventhandler.pir  (original)
+++ branches/pdd15oo/examples/sdl/minesweeper/eventhandler.pir  Wed Oct  3 
10:14:24 2007
@@ -4,11 +4,9 @@
 
 =head1 SYNOPSIS
 
-    find_type $I0, "SDL::Event"
-    $P0 = new $I0
+    $P0 = new "SDL::Event"
 
-    find_type $I0, "Mines::EventHandler"
-    $P1 = new $I0
+    $P1 = new "Mines::EventHandler"
 
     $P0."process_events"( 0.1, $P1, field )
 

Modified: branches/pdd15oo/examples/sdl/minesweeper/field.pir
==============================================================================
--- branches/pdd15oo/examples/sdl/minesweeper/field.pir (original)
+++ branches/pdd15oo/examples/sdl/minesweeper/field.pir Wed Oct  3 10:14:24 2007
@@ -16,8 +16,7 @@
     $P0['debug']  = debug
 
     # create the field
-    $I0 = find_type "Mines::Field"
-    field = new $I0, $P0
+    field = new "Mines::Field", $P0
 
     # draw the field
     field.'draw'()
@@ -133,13 +132,11 @@
     field  = new 'ResizablePMCArray'
     cache  = new 'ResizablePMCArray'
 
-    $I0 = find_type 'SDL::StopWatch'
-    watch = new $I0, screen
+    watch = new 'SDL::StopWatch', screen
     watch.'xpos'( 515 )
     watch.'ypos'( 5 )
 
-    $I0 = find_type 'SDL::LCD'
-    lcd = new $I0
+    lcd = new 'SDL::LCD'
     # This seems to call __init() with too many parameters
     # lcd = 0
     lcd.'_digits'( 4 )
@@ -202,8 +199,7 @@
     inc $I0
     $P0 = new 'String'
     $P0 = "examples/sdl/minesweeper/smiley.png"
-    $I1 = find_type "SDL::Button"
-    $P0 = new $I1, $P0
+    $P0 = new "SDL::Button", $P0
     $P0.'states'( 5 )
     $P0.'pos'( 305, 2 )
     $P0.'size'( 30, 30 )
@@ -376,16 +372,15 @@
 DEBUG:
     image = find_global "Mines::Field", "field_debug"
 IMAGE_OK:
-    $I0 = find_type "SDL::Rect"
     $P0 = new 'Hash'
     $P0['x'] = 0
     $P0['y'] = 0
     $P0['width']  = 0
     $P0['height'] = 0
-    dest_rect = new $I0, $P0
+    dest_rect = new "SDL::Rect", $P0
     $P0['width']  = FIELD_WIDTH
     $P0['height'] = FIELD_HEIGHT
-    src_rect = new $I0, $P0
+    src_rect = new "SDL::Rect", $P0
 
     set size, width
     mul size, height
@@ -1091,8 +1086,7 @@
 
     $P0 = new 'String'
     $P0 = "examples/sdl/minesweeper/mines.png"
-    $I0 = find_type "SDL::Image"
-    image = new $I0, $P0
+    image = new "SDL::Image", $P0
     store_global "Mines::Field", "field", image
 
     $P0 = new 'String'

Modified: branches/pdd15oo/examples/sdl/minesweeper/mines.pir
==============================================================================
--- branches/pdd15oo/examples/sdl/minesweeper/mines.pir (original)
+++ branches/pdd15oo/examples/sdl/minesweeper/mines.pir Wed Oct  3 10:14:24 2007
@@ -46,8 +46,7 @@
     $P0["flags"]  =   5
 
     # create the SDL object
-    find_type $I0, "SDL::App"
-    $P0 = new $I0, $P0
+    $P0 = new "SDL::App", $P0
     screen = $P0."surface"()
     
     # choose a "random" field
@@ -64,17 +63,14 @@
     $P0['debug']  = debug
     
     # create the field
-    $I0 = find_type "Mines::Field"
-    field = new $I0, $P0
+    field = new "Mines::Field", $P0
 
     # draw the field
     field.'draw'()
             
     # runloop
-    find_type $I0, "SDL::Event"
-    $P0 = new $I0
-    find_type $I0, "Mines::EventHandler"
-    $P1 = new $I0
+    $P0 = new "SDL::Event"
+    $P1 = new "Mines::EventHandler"
     $P0."process_events"( 0.1, $P1, field )
 
     end

Reply via email to