lib/sc2ai/player/debug.rb in sc2ai-0.2.0 vs lib/sc2ai/player/debug.rb in sc2ai-0.3.0

- old
+ new

@@ -20,11 +20,11 @@ # Draw Commands --- # Prints debug text top left corner # @param text [String] will respect newlines - # @param size [Size] of font, default 14px + # @param size [Integer] of font, default 14px # @return [void] def debug_print(text, size: 14) queue_debug_command Api::DebugCommand.new( draw: Api::DebugDraw.new( text: [ @@ -41,11 +41,11 @@ # Prints text on screen from top and left # @param text [String] will respect newlines # @param left_percent [Numeric] range 0..100. percent from left of screen # @param top_percent [Numeric] range 0..100. percent from top of screen # @param color [Api::Color] default white - # @param size [Size] of font, default 14px + # @param size [Integer] of font, default 14px # @return [void] def debug_text_screen(text, left_percent: 1.0, top_percent: 1.0, color: nil, size: 14) queue_debug_command Api::DebugCommand.new( draw: Api::DebugDraw.new( text: [ @@ -65,11 +65,11 @@ # Prints text on screen at 3d world position # @param text [String] will respect newlines # @param point [Api::Point] point in the world, i.e. unit.pos # @param color [Api::Color] default white - # @param size [Size] of font, default 14px + # @param size [Integer] of font, default 14px # @return [void] def debug_text_world(text, point:, color: nil, size: 14) queue_debug_command Api::DebugCommand.new( draw: Api::DebugDraw.new( text: [ @@ -150,11 +150,11 @@ end # Renders a block on the floor, drawn by 4 lines # Pass in either a pos (Position/Unit) or exact x * y coordinates # Optional indentation adds padding on borders inward - # @param pos [Api::Unit, Api::Position] + # @param pos [Api::Unit, Sc2::Position] # @param x [Float, Integer] # @param y [Float, Integer] # @param color [Api::Color] # @param indent [Float] default 0.05. should be lower than < 1.0 # @example @@ -164,12 +164,12 @@ def debug_tile(pos = nil, x: nil, y: nil, color: nil, indent: 0.05) if pos.is_a?(Api::Unit) x = pos.pos.x.floor y = pos.pos.y.floor elsif pos.is_a?(Sc2::Position) - x = pos.pos.x.floor - y = pos.pos.y.floor + x = pos.x.floor + y = pos.y.floor end # Raise above floor to prevent texture clipping z = geo.terrain_height(x:, y:).to_f + 0.1 tl = Api::Point[x + indent, y + 1.0 - indent, z] @@ -185,22 +185,22 @@ # Other Commands --- # @param command [Integer] one of Api::DebugGameState::* # Possible values: - # Api::DebugGameState::Show_map - # Api::DebugGameState::Control_enemy - # Api::DebugGameState::Food - # Api::DebugGameState::Free - # Api::DebugGameState::All_resources - # Api::DebugGameState::God - # Api::DebugGameState::Minerals - # Api::DebugGameState::Gas - # Api::DebugGameState::Cooldown - # Api::DebugGameState::Tech_tree - # Api::DebugGameState::Upgrade - # Api::DebugGameState::Fast_build + # Api::DebugGameState::SHOW_MAP + # Api::DebugGameState::CONTROL_ENEMY + # Api::DebugGameState::FOOD + # Api::DebugGameState::FREE + # Api::DebugGameState::ALL_RESOURCES + # Api::DebugGameState::GOD + # Api::DebugGameState::MINERALS + # Api::DebugGameState::GAS + # Api::DebugGameState::COOLDOWN + # Api::DebugGameState::TECH_TREE + # Api::DebugGameState::UPGRADE + # Api::DebugGameState::FAST_BUILD # @return [void] def debug_game_state(command) queue_debug_command Api::DebugCommand.new( game_state: command ) @@ -235,11 +235,11 @@ ) end # @private # Hangs, crashes and exits the Sc2 client. DO NOT USE. - # @param test [Integer] one of Api::DebugTestProcess::Test::Crash, Api::DebugTestProcess::Test::Hang, Api::DebugTestProcess::Test::Exit + # @param test [Integer] one of Api::DebugTestProcess::Test::CRASH, Api::DebugTestProcess::Test::HANG, Api::DebugTestProcess::Test::EXIT # @param delay_ms [Integer] default 0, how long this test is delayed # @return [void] def debug_test_process(test:, delay_ms: 0) queue_debug_command Api::DebugCommand.new( test_process: Api::DebugTestProcess.new( @@ -258,11 +258,11 @@ score: ) ) end - # Ends game with a specified result of either Surrender or DeclareVictory - # @param end_result [Integer] either 1/2. Api::DebugEndGame::EndResult::Surrender or Api::DebugEndGame::EndResult::DeclareVictory + # Ends game with a specified result of either :SURRENDER or :DECLARE_VICTORY + # @param end_result [Integer] either 1/2. Api::DebugEndGame::EndResult::SURRENDER or Api::DebugEndGame::EndResult::DECLARE_VICTORY # @return [void] def debug_end_game(end_result:) queue_debug_command Api::DebugCommand.new( end_game: Api::DebugEndGame.new( end_result: