• R/O
  • SSH
  • HTTPS

nlgp1: Commit


Commit MetaInfo

Revision829 (tree)
Zeit2011-03-02 02:45:43
Autorbiikame

Log Message

識別子を一部修正

Ändern Zusammenfassung

Diff

--- trunk/Nlgp1/Nlgp1/Motions/ISpriteMotionOwner.cs (revision 828)
+++ trunk/Nlgp1/Nlgp1/Motions/ISpriteMotionOwner.cs (revision 829)
@@ -1,5 +1,4 @@
1-
2-using System;
1+using System;
32 using System.Collections.Generic;
43 using System.Linq;
54 using System.Text;
--- trunk/Nlgp1/Nlgp1/Views/StageDebugView.cs (revision 828)
+++ trunk/Nlgp1/Nlgp1/Views/StageDebugView.cs (revision 829)
@@ -4,7 +4,7 @@
44
55 namespace Nlgp1.Views {
66
7- public sealed class StageDebugView : IStageWorldDebugView {
7+ public sealed class StageDebugView : IStageDebugView {
88
99 public Vector Transform( Vector source ) {
1010 return StageView.ToScreenPosition( source );
--- trunk/Nlgp1/Nlgp1/Parameters/IStageWorldDebugView.cs (revision 828)
+++ trunk/Nlgp1/Nlgp1/Parameters/IStageWorldDebugView.cs (nonexistent)
@@ -1,18 +0,0 @@
1-using System;
2-using Nlgp1.Utilities;
3-
4-namespace Nlgp1.Parameters
5-{
6- /// <summary>
7- /// IStageWorldのデバッグ描画用のインターフェイス
8- /// </summary>
9- public interface IStageWorldDebugView
10- {
11- /// <summary>
12- /// World座標からScreen座標へ変換する
13- /// </summary>
14- /// <param name="source">変換元の座標</param>
15- /// <returns>変換先の座標</returns>
16- Vector Transform(Vector source);
17- }
18-}
--- trunk/Nlgp1/Nlgp1/Parameters/StageWorldDebugDraw.cs (revision 828)
+++ trunk/Nlgp1/Nlgp1/Parameters/StageWorldDebugDraw.cs (nonexistent)
@@ -1,82 +0,0 @@
1-using System;
2-using System.Collections.Generic;
3-using System.Linq;
4-using Box2DX.Common;
5-using Box2DX.Dynamics;
6-using Nlgp1.Box2DX;
7-using Nlgp1.Stages;
8-using Nlgp1.Utilities;
9-
10-namespace Nlgp1.Parameters {
11-
12- internal sealed class StageWorldDebugDraw : DebugDraw {
13-
14- public StageWorldDebugDraw( IStageWorldDebugView view ) {
15- this.Flags = DrawFlags.Shape;
16- this.view = view;
17- }
18-
19- public void Step() {
20- foreach( Action action in this.actions ) {
21- action();
22- }
23- this.actions.Clear();
24- }
25-
26- public override void DrawPolygon( Vec2[] vertices , int vertexCount , Color color ) {
27- this.DrawPolygon( vertices , vertexCount , color , false );
28- }
29-
30- public override void DrawSolidPolygon( Vec2[] vertices , int vertexCount , Color color ) {
31- this.DrawPolygon( vertices , vertexCount , color , true );
32- }
33-
34- private void DrawPolygon( IEnumerable< Vec2 > vertices , int vertexCount , Color color , bool isSolid ) {
35- this.actions.Add( () => {
36- Vec2[] verticesAsScreen = vertices.Select( ( vertex ) => ( Vec2 )( this.view.Transform( vertex ) ) ).ToArray();
37- if( isSolid ) {
38- this.debug.DrawSolidPolygon( verticesAsScreen , vertexCount , color );
39- }
40- else {
41- this.debug.DrawPolygon( verticesAsScreen , vertexCount , color );
42- }
43- } );
44- }
45-
46- public override void DrawCircle( Vec2 center , float radius , Color color ) {
47- this.DrawCircle( center , radius , new Vector() , color , false );
48- }
49-
50- public override void DrawSolidCircle( Vec2 center , float radius , Vec2 axis , Color color ) {
51- this.DrawCircle( center , radius , axis , color , true );
52- }
53-
54- private void DrawCircle( Vec2 center , float radius , Vec2 axis , Color color , bool isSolid ) {
55- this.actions.Add( () => {
56- Vec2 centerAsScreen = this.view.Transform( center );
57- if( isSolid ) {
58- this.debug.DrawSolidCircle( centerAsScreen , radius , axis , color );
59- }
60- else {
61- this.debug.DrawCircle( centerAsScreen , radius , color );
62- }
63- } );
64- }
65-
66- public override void DrawSegment( Vec2 p1 , Vec2 p2 , Color color ) {
67- this.actions.Add( () => {
68- this.debug.DrawSegment( this.view.Transform( p1 ) , this.view.Transform( p2 ) , color );
69- } );
70- }
71-
72- public override void DrawXForm( XForm xf ) {
73- this.actions.Add( () => {
74- this.debug.DrawXForm( xf );
75- } );
76- }
77-
78- private readonly List< Action > actions = new List< Action >();
79- private readonly Debug debug = new Debug();
80- private readonly IStageWorldDebugView view;
81- }
82-}
--- trunk/Nlgp1/Nlgp1/Parameters/StageWorld.cs (revision 828)
+++ trunk/Nlgp1/Nlgp1/Parameters/StageWorld.cs (revision 829)
@@ -8,12 +8,12 @@
88 {
99 internal sealed class StageWorld : IStageWorld
1010 {
11- public StageWorld(Rectangle area, IStageWorldDebugView debugView)
11+ public StageWorld(Rectangle area, IStageDebugView debugView)
1212 {
1313 this.world = new World(area, new Vec2(), false);
1414 this.listener = new SpriteContactListener();
1515 this.world.SetContactListener(this.listener);
16- this.debugDraw = new StageWorldDebugDraw(debugView);
16+ this.debugDraw = new StageDebugDraw(debugView);
1717 this.world.SetDebugDraw(this.debugDraw);
1818 }
1919
@@ -32,6 +32,6 @@
3232
3333 private readonly World world;
3434 private readonly SpriteContactListener listener;
35- private readonly StageWorldDebugDraw debugDraw;
35+ private readonly StageDebugDraw debugDraw;
3636 }
3737 }
--- trunk/Nlgp1/Nlgp1/Parameters/IStageDebugView.cs (nonexistent)
+++ trunk/Nlgp1/Nlgp1/Parameters/IStageDebugView.cs (revision 829)
@@ -0,0 +1,18 @@
1+using System;
2+using Nlgp1.Utilities;
3+
4+namespace Nlgp1.Parameters
5+{
6+ /// <summary>
7+ /// IStageWorldのデバッグ描画用のインターフェイス
8+ /// </summary>
9+ public interface IStageDebugView
10+ {
11+ /// <summary>
12+ /// World座標からScreen座標へ変換する
13+ /// </summary>
14+ /// <param name="source">変換元の座標</param>
15+ /// <returns>変換先の座標</returns>
16+ Vector Transform(Vector source);
17+ }
18+}
--- trunk/Nlgp1/Nlgp1/Parameters/StageDebugDraw.cs (nonexistent)
+++ trunk/Nlgp1/Nlgp1/Parameters/StageDebugDraw.cs (revision 829)
@@ -0,0 +1,82 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using Box2DX.Common;
5+using Box2DX.Dynamics;
6+using Nlgp1.Box2DX;
7+using Nlgp1.Stages;
8+using Nlgp1.Utilities;
9+
10+namespace Nlgp1.Parameters {
11+
12+ internal sealed class StageDebugDraw : DebugDraw {
13+
14+ public StageDebugDraw( IStageDebugView view ) {
15+ this.Flags = DrawFlags.Shape;
16+ this.view = view;
17+ }
18+
19+ public void Step() {
20+ foreach( Action action in this.actions ) {
21+ action();
22+ }
23+ this.actions.Clear();
24+ }
25+
26+ public override void DrawPolygon( Vec2[] vertices , int vertexCount , Color color ) {
27+ this.DrawPolygon( vertices , vertexCount , color , false );
28+ }
29+
30+ public override void DrawSolidPolygon( Vec2[] vertices , int vertexCount , Color color ) {
31+ this.DrawPolygon( vertices , vertexCount , color , true );
32+ }
33+
34+ private void DrawPolygon( IEnumerable< Vec2 > vertices , int vertexCount , Color color , bool isSolid ) {
35+ this.actions.Add( () => {
36+ Vec2[] verticesAsScreen = vertices.Select( ( vertex ) => ( Vec2 )( this.view.Transform( vertex ) ) ).ToArray();
37+ if( isSolid ) {
38+ this.debug.DrawSolidPolygon( verticesAsScreen , vertexCount , color );
39+ }
40+ else {
41+ this.debug.DrawPolygon( verticesAsScreen , vertexCount , color );
42+ }
43+ } );
44+ }
45+
46+ public override void DrawCircle( Vec2 center , float radius , Color color ) {
47+ this.DrawCircle( center , radius , new Vector() , color , false );
48+ }
49+
50+ public override void DrawSolidCircle( Vec2 center , float radius , Vec2 axis , Color color ) {
51+ this.DrawCircle( center , radius , axis , color , true );
52+ }
53+
54+ private void DrawCircle( Vec2 center , float radius , Vec2 axis , Color color , bool isSolid ) {
55+ this.actions.Add( () => {
56+ Vec2 centerAsScreen = this.view.Transform( center );
57+ if( isSolid ) {
58+ this.debug.DrawSolidCircle( centerAsScreen , radius , axis , color );
59+ }
60+ else {
61+ this.debug.DrawCircle( centerAsScreen , radius , color );
62+ }
63+ } );
64+ }
65+
66+ public override void DrawSegment( Vec2 p1 , Vec2 p2 , Color color ) {
67+ this.actions.Add( () => {
68+ this.debug.DrawSegment( this.view.Transform( p1 ) , this.view.Transform( p2 ) , color );
69+ } );
70+ }
71+
72+ public override void DrawXForm( XForm xf ) {
73+ this.actions.Add( () => {
74+ this.debug.DrawXForm( xf );
75+ } );
76+ }
77+
78+ private readonly List< Action > actions = new List< Action >();
79+ private readonly Debug debug = new Debug();
80+ private readonly IStageDebugView view;
81+ }
82+}
--- trunk/Nlgp1/Nlgp1/Parameters/StageWorldFactory.cs (revision 828)
+++ trunk/Nlgp1/Nlgp1/Parameters/StageWorldFactory.cs (revision 829)
@@ -15,7 +15,7 @@
1515 /// <param name="area">範囲</param>
1616 /// <param name="debugView">デバッグ描画用のインターフェイス</param>
1717 /// <returns>作成されたオブジェクト</returns>
18- public static IStageWorld CreateStageWorld(Rectangle area, IStageWorldDebugView debugView)
18+ public static IStageWorld CreateStageWorld(Rectangle area, IStageDebugView debugView)
1919 {
2020 return new StageWorld(area, debugView);
2121 }
Show on old repository browser