-
Notifications
You must be signed in to change notification settings - Fork 1
Refactoring
Nonki Takahashi (Mac) edited this page Apr 19, 2020
·
9 revisions
This page illustrates what kind of refactoring will be done for this project.
Update version information.
Use Init()
subroutine such as following code.
Sub Init
gw = 598
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
GraphicsWindow.BackgroundColor = "LightGray"
EndSub
Use Array.GetItemCount(shape)
instead of hard coded number.
Replace Shape_Add()
to Stripe_Add()
.
maker/CaptionMaker.sb will create such as following code.
Sub Shapes_Init_Caption
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 426 ' x offset
shY = 358 ' y offset
shape = ""
shape[1] = "func=text;x=0;y=0;text=Ellipse;fn=Trebuchet MS;fs=50;fb=True;pw=0;bc=Black;"
EndSub
Use this code to show the caption.
Add a new line between subroutines.
maker/FindSubNotUsed.sb will find subroutines not used. Following list is a sample output.
C:\Users\nonki\Documents\GitHub\Pictionary\Ellipse.sb Math_CartesianToPolar Shapes_CalcRotatePos Shapes_Move Shapes_Remove Shapes_Rotate
This means that subroutines Math_CartesianToPolar, Shapes_CalcRotatePos, Shapes_Move, Shapes_Remove and Shapes_Rotate should be removed from Ellipse.sb
Copyright © 2017-2020 Nonki Takahashi.
This work is licensed under a Creative Commons Attribution 4.0 International License.