-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit test and diagram changes #36
Open
mohithsrao
wants to merge
64
commits into
master
Choose a base branch
from
PawnGoal
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
9688b9c
Made Pawns visible while selecting
mohithsrao 26008a6
Update main.yml
mohithsrao e41788d
Corrected Syntax
mohithsrao 55fe301
Corrected syntax
mohithsrao 2e91f5b
Used default build task
mohithsrao 322793e
Updated directory for build task
mohithsrao 2efa79f
Updated build and added release task
mohithsrao 278ad3e
Updated build actions
mohithsrao 3f379ee
Merge branch 'master' into PawnGoal
mohithsrao 0bfcdae
Cahnged release notes generation
mohithsrao f61a7f9
formated the tag as required
mohithsrao ab3003a
made formating into saparate step
mohithsrao f970aea
corrected run task
mohithsrao 43fd273
Updated set variable for output
mohithsrao 28cf5a3
corrected variable
mohithsrao e6aa098
Added params for getting additional change logs
mohithsrao d3db007
Corrected syntax
mohithsrao 781524d
Included html files to build
mohithsrao 2e47aab
saparated build and release jobs
mohithsrao 1343357
Corrected artifacts for release
mohithsrao 03de2ce
Updated release artifacts paths
mohithsrao f28f441
corrected yml syntax
mohithsrao 7e19e11
corrected artifact name
mohithsrao fb2ff82
Added zip files
mohithsrao 4ea4a1e
removed extra path folder
mohithsrao 267c334
changed the artifacts to tar's instead of direct files
mohithsrao 0fd9a75
corrected path for upload
mohithsrao ccdc833
corrected tar path
mohithsrao 332327e
corrected tar path
mohithsrao 39615d8
removed unnecessary path for tar file
mohithsrao 0eba5bd
corrected artifact name while uploading.
mohithsrao 633f131
asset path correction
mohithsrao f22f1d1
Updated main release with updated changes
mohithsrao f784ac0
Updated Build path
mohithsrao 0b26cde
Merge branch 'master' into PawnGoal
mohithsrao bc3ad29
Updated path for build
mohithsrao 7fa82b9
Merge branch 'master' into PawnGoal
mohithsrao 02ceeaf
updated export preset names
mohithsrao f87cd76
Merge branch 'master' into PawnGoal
mohithsrao 2efd64a
changed base directory
mohithsrao aceff8e
Merge branch 'master' into PawnGoal
mohithsrao 3b020e1
Removed change directory
mohithsrao 02811f7
Merge branch 'master' into PawnGoal
mohithsrao 6051b50
fixed syntax
mohithsrao c138a2f
Merge branch 'master' into PawnGoal
mohithsrao 89afd0c
changed ped location
mohithsrao a65a224
Merge branch 'master' into PawnGoal
mohithsrao cd821b2
changed tar's to zip files
mohithsrao d963b4e
Merge branch 'master' into PawnGoal
mohithsrao 29bc576
Corrected task name to zip
mohithsrao 090cb40
removed sudo
mohithsrao 8758601
Merge branch 'master' into PawnGoal
mohithsrao 78e95ba
changed zip path
mohithsrao bad6e15
Merge branch 'master' into PawnGoal
mohithsrao 863c35d
Updated badge and redirecting changelog.md file to release Body
mohithsrao 8447d3f
Merge branch 'master' into PawnGoal
mohithsrao a881fb9
Updated command
mohithsrao 34dc554
Printing md file
mohithsrao a62c988
Used body_path instead of body
mohithsrao feed234
Merge branch 'master' into PawnGoal
mohithsrao e4e9bcc
Added Notification Text
mohithsrao 183b862
Added notification and Unit test for playerto project
mohithsrao 9df3461
Updated diagrams for new systems to be implemented
mohithsrao 55e7672
Updated diagram for opaen class structure
mohithsrao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ export.cfg | |
|
||
#Build and Release ignores | ||
Bin/ | ||
addons/ | ||
|
||
#VSCode-specific ignores | ||
.vscode/ | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
extends Position2D | ||
|
||
onready var lable = get_node("Label") | ||
onready var tween = get_node("Tween") | ||
var notificationString = "" | ||
|
||
export var tween_duration = 0.5 | ||
export var notification_length = 3 | ||
|
||
func _ready(): | ||
lable.text = notificationString | ||
tween.connect("tween_all_completed", self, "_on_Tween_tween_all_completed") | ||
|
||
tween.interpolate_property(self, 'scale' , scale ,Vector2(1,1), tween_duration, Tween.TRANS_LINEAR, Tween.EASE_OUT) | ||
tween.interpolate_property(self, 'scale' ,Vector2(1,1), scale , tween_duration, Tween.TRANS_LINEAR, Tween.EASE_IN, notification_length) | ||
tween.start() | ||
|
||
func _on_Tween_tween_all_completed(): | ||
self.queue_free() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://Scenes/HUD/NotifiationText.gd" type="Script" id=1] | ||
|
||
[node name="NotificationText" type="Position2D"] | ||
scale = Vector2( 0.5, 0.5 ) | ||
script = ExtResource( 1 ) | ||
|
||
[node name="Label" type="Label" parent="."] | ||
anchor_left = 0.5 | ||
anchor_top = 1.0 | ||
anchor_right = 0.5 | ||
anchor_bottom = 1.0 | ||
margin_left = -75.0 | ||
margin_top = -30.0 | ||
margin_right = 75.0 | ||
grow_vertical = 0 | ||
custom_colors/font_color = Color( 0.976471, 0.219608, 0.0196078, 1 ) | ||
custom_colors/font_outline_modulate = Color( 0.988235, 0.988235, 0.988235, 1 ) | ||
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) | ||
text = "Test Notification" | ||
align = 1 | ||
valign = 1 | ||
autowrap = true | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
|
||
[node name="Tween" type="Tween" parent="."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
extends Node | ||
|
||
func CheckPlayerTurnForGara(garaList:Array) -> bool: | ||
var parent = get_parent() | ||
var children = parent.get_children() | ||
var crieteria = funcref(self,"_GetPawns") | ||
var pawnChildren = _filter(children,crieteria) | ||
|
||
var canPlayerMovePawn = false | ||
for pawn in pawnChildren: | ||
var canPawnMove = false | ||
var previousGara:int = 0 | ||
for n in range(garaList.size()): | ||
if(n != 0): | ||
previousGara = garaList[n-1] | ||
var currentGara:int = garaList[n] | ||
var garaToCheck = previousGara + currentGara | ||
canPawnMove = (pawn as Pawn).canMoveSelectedTurn(garaToCheck,false) | ||
if(canPawnMove): | ||
canPlayerMovePawn = true | ||
break | ||
|
||
return canPlayerMovePawn | ||
|
||
func _GetPawns(child) -> bool: | ||
return child is Pawn; | ||
|
||
func _filter(list: Array, matches_criteria: FuncRef) -> Array: | ||
# Usually better to add filtered elements to new array | ||
# because removing elements while iterating over a list | ||
# causes weird behaviour | ||
var filtered: Array = [] | ||
for element in list: | ||
if matches_criteria.call_func(element): | ||
filtered.append(element) | ||
return filtered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
extends "res://addons/gut/test.gd" | ||
|
||
var PlayerScene: PackedScene = preload("res://Scenes/Player/Player.tscn") | ||
var player = PlayerScene.instance() | ||
|
||
func before_all(): | ||
gut.p("Runs once before all tests") | ||
var child = add_child(player) | ||
PlayerInfo.active_player = player | ||
|
||
func before_each(): | ||
gut.p("Runs before each test.") | ||
|
||
func after_each(): | ||
gut.p("Runs after each test.") | ||
|
||
func after_all(): | ||
gut.p("Runs once after all tests") | ||
player.free() | ||
|
||
func test_player_is_not_null(): | ||
assert_not_null(player) | ||
|
||
func test_CheckScript_is_not_null(): | ||
var checkScript = player.get_node("CheckPlayerTurnValidity").get_script() | ||
assert_not_null(checkScript) | ||
|
||
func test_player_gara_should_fail_when_no_pawn_can_move(): | ||
var garaList = [8,8,8,8,8,8,8,8,8,2] | ||
var checkNodeScript = player.get_node("CheckPlayerTurnValidity") | ||
|
||
var result = checkNodeScript.CheckPlayerTurnForGara(garaList) | ||
|
||
assert_false(result,"Should pass when no pawns are able to move") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/gut/plugin_control.gd" type="Script" id=1] | ||
|
||
[node name="Gut" type="Control"] | ||
margin_right = 740.0 | ||
margin_bottom = 250.0 | ||
rect_min_size = Vector2( 740, 250 ) | ||
script = ExtResource( 1 ) | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
_run_on_load = true | ||
_should_maximize = true | ||
_include_subdirectories = true | ||
_directory1 = "res://UnitTests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[1230/191809.452:ERROR:settings.cc(325)] Settings version is not 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the debug.log and maybe add this in .gitignore |
||
[0102/130853.266:ERROR:settings.cc(325)] Settings version is not 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line at the end