├── .clang-format ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── data └── download.sh ├── game ├── .gitignore ├── CMakeLists.txt ├── README.md ├── ai │ ├── ai.h │ ├── ai_factory.cc │ ├── ai_factory.h │ ├── ai_option.h │ ├── cheat_executor_ai.h │ ├── cmd_reply.cc │ ├── cmd_reply.h │ ├── coach_instruction.h │ ├── comm_ai.cc │ ├── comm_ai.h │ ├── dual_extractor.h │ ├── executor_extractor.cc │ ├── executor_extractor.h │ ├── raw2cmd.cc │ ├── raw2cmd.h │ ├── replay_loader.cc │ ├── replay_loader.h │ ├── rule_ai.cc │ ├── rule_ai.h │ ├── rule_extractor.cc │ ├── rule_extractor.h │ ├── save2json.cc │ ├── save2json.h │ ├── state_dumper.cc │ ├── state_dumper.h │ ├── test_ai.h │ ├── trainable_ai.h │ ├── trainable_executor_ai.h │ └── trainable_rule_ai.h ├── backend │ └── main_loop.cc ├── compile_cmds.py ├── engine │ ├── bullet.cc │ ├── bullet.h │ ├── cmd.cc │ ├── cmd.def │ ├── cmd.h │ ├── cmd_interface.h │ ├── cmd_receiver.cc │ ├── cmd_receiver.h │ ├── cmd_specific.cc │ ├── cmd_specific.def │ ├── cmd_target.cc │ ├── cmd_target.h │ ├── cmd_util.cc │ ├── cmd_util.h │ ├── common.h │ ├── const.h │ ├── custom_enum.h │ ├── game_action.cc │ ├── game_action.h │ ├── game_base.h │ ├── game_env.cc │ ├── game_env.h │ ├── game_option.h │ ├── game_state.cc │ ├── game_state.h │ ├── game_state_ext.h │ ├── game_stats.h │ ├── gamedef.h │ ├── locality_search.h │ ├── lua │ │ ├── cpp_interface.cc │ │ ├── cpp_interface.h │ │ ├── lua_interface.cc │ │ ├── lua_interface.h │ │ ├── utils.cc │ │ └── utils.h │ ├── map.cc │ ├── map.h │ ├── mc_rule_actor.cc │ ├── mc_rule_actor.h │ ├── mc_strategy_actor.cc │ ├── mc_strategy_actor.h │ ├── player.cc │ ├── player.h │ ├── pq_extend.h │ ├── preload.cc │ ├── preload.h │ ├── rule_actor.cc │ ├── rule_actor.h │ ├── serializer.h │ ├── test.lua │ ├── test2.lua │ ├── ui_cmd.h │ ├── unit.cc │ ├── unit.h │ ├── unit_property.h │ ├── unit_template.h │ ├── utils.cc │ └── utils.h ├── frontend │ ├── game.js │ ├── imgs │ │ ├── 14SAF.png │ │ ├── 2ebyiko.png │ │ ├── 2eki549.png │ │ ├── Actor1_zps2890a1cd.png │ │ ├── Actor2.png │ │ ├── Christmas.png │ │ ├── People3.png │ │ ├── People4.png │ │ ├── RTPkaihenn18.png │ │ ├── Spacece.png │ │ ├── Sprites-Lunarea.png │ │ ├── attack_graph.png │ │ ├── barracks.png │ │ ├── base.png │ │ ├── building.png │ │ ├── char_sample_zpsef814b4c.png │ │ ├── factory.png │ │ ├── intro.png │ │ ├── items.png │ │ ├── items_12.png │ │ ├── mineral1.png │ │ └── tiles.png │ ├── media │ │ └── door_bell.mp3 │ ├── minirts.html │ └── rts │ │ ├── blue │ │ ├── barrack.png │ │ ├── base.png │ │ ├── cannon.png │ │ ├── cavalry.png │ │ ├── defense_tower.png │ │ ├── engineer.png │ │ ├── factory.png │ │ ├── flight.png │ │ ├── hangar.png │ │ ├── resource.png │ │ ├── scifiUnit_05.png │ │ ├── scifiUnit_06.png │ │ ├── scifiUnit_07.png │ │ ├── scifiUnit_09.png │ │ ├── scifiUnit_10.png │ │ ├── soldier.png │ │ ├── spaceman.png │ │ ├── spearman.png │ │ ├── tank.png │ │ ├── tower.png │ │ ├── truck.png │ │ ├── worker.png │ │ └── workshop.png │ │ ├── medieval │ │ ├── actions │ │ │ ├── accept.gif │ │ │ ├── attack.gif │ │ │ ├── build.gif │ │ │ ├── finish.gif │ │ │ ├── gather.gif │ │ │ ├── issue.gif │ │ │ ├── move.gif │ │ │ └── stop.gif │ │ ├── blue │ │ │ ├── archer.png │ │ │ ├── archer_attack.png │ │ │ ├── archery.png │ │ │ ├── aviary.png │ │ │ ├── barrack.png │ │ │ ├── blacksmith.png │ │ │ ├── catapult.png │ │ │ ├── catapult_attack.png │ │ │ ├── cavalry.png │ │ │ ├── cavalry_attack.png │ │ │ ├── coin.png │ │ │ ├── dragon.png │ │ │ ├── dragon_attack.png │ │ │ ├── guard_tower.png │ │ │ ├── peasant.png │ │ │ ├── peasant_attack.png │ │ │ ├── spearman.png │ │ │ ├── spearman_attack.png │ │ │ ├── stable.png │ │ │ ├── swordman.png │ │ │ ├── swordman_attack.png │ │ │ ├── town_hall.png │ │ │ └── workshop.png │ │ └── red │ │ │ ├── archer.png │ │ │ ├── archer_attack.png │ │ │ ├── archery.png │ │ │ ├── aviary.png │ │ │ ├── barrack.png │ │ │ ├── blacksmith.png │ │ │ ├── catapult.png │ │ │ ├── catapult_attack.png │ │ │ ├── cavalry.png │ │ │ ├── cavalry_attack.png │ │ │ ├── coin.png │ │ │ ├── dragon.png │ │ │ ├── dragon_attack.png │ │ │ ├── guard_tower.png │ │ │ ├── peasant.png │ │ │ ├── peasant_attack.png │ │ │ ├── spearman.png │ │ │ ├── spearman_attack.png │ │ │ ├── stable.png │ │ │ ├── swordman.png │ │ │ ├── swordman_attack.png │ │ │ ├── town_hall.png │ │ │ └── workshop.png │ │ ├── red │ │ ├── barrack.png │ │ ├── base.png │ │ ├── cannon.png │ │ ├── cavalry.png │ │ ├── defense_tower.png │ │ ├── engineer.png │ │ ├── factory.png │ │ ├── flight.png │ │ ├── hangar.png │ │ ├── resource.png │ │ ├── scifiUnit_17.png │ │ ├── scifiUnit_18.png │ │ ├── scifiUnit_19.png │ │ ├── scifiUnit_21.png │ │ ├── scifiUnit_22.png │ │ ├── soldier.png │ │ ├── spaceman.png │ │ ├── spearman.png │ │ ├── tank.png │ │ ├── tower.png │ │ ├── truck.png │ │ ├── worker.png │ │ └── workshop.png │ │ └── terrain │ │ ├── fog.png │ │ ├── forest.png │ │ ├── grass.png │ │ ├── ground.png │ │ ├── killed_forest.png │ │ ├── rock.png │ │ ├── sand.png │ │ ├── soil.png │ │ ├── stump.png │ │ └── water.png ├── game_MC │ ├── cmd_specific.cc │ ├── cmd_specific.def │ ├── gamedef.cc │ └── lua │ │ ├── attack_rule_book.lua │ │ ├── cpp_interface.cc │ │ ├── cpp_interface.h │ │ ├── lua_interface.cc │ │ ├── lua_interface.h │ │ ├── map_generator.lua │ │ ├── random.lua │ │ ├── unit_factory.lua │ │ └── unit_generator.lua ├── pybind.cc └── utils │ ├── lua │ ├── common.h │ ├── interface.h │ └── state_holder.h │ ├── ws_config.h │ └── ws_server.h ├── install_apache.sh ├── pretrained_models ├── download.sh └── update_path.py ├── scripts ├── README.md ├── behavior_clone │ ├── .gitignore │ ├── analyze_match.py │ ├── best_models.py │ ├── cmd_heads.py │ ├── coach_dataset.py │ ├── common_utils │ ├── cont_softmax_sampler.py │ ├── conv_glob_encoder.py │ ├── conv_module.py │ ├── dataset.py │ ├── executor.py │ ├── executor_wrapper.py │ ├── human_coach.py │ ├── inst_dict.py │ ├── instruction_encoder.py │ ├── instruction_generator.py │ ├── instruction_selector.py │ ├── match.py │ ├── match2.py │ ├── module.py │ ├── onehot_coach.py │ ├── reducer.py │ ├── rnn_coach.py │ ├── rnn_generator.py │ ├── scripts │ │ ├── coach_bow250.sh │ │ ├── coach_bow50.sh │ │ ├── coach_bow500.sh │ │ ├── coach_onehot250.sh │ │ ├── coach_onehot50.sh │ │ ├── coach_onehot500.sh │ │ ├── coach_rnn250.sh │ │ ├── coach_rnn50.sh │ │ ├── coach_rnn500.sh │ │ ├── coach_rnn_gen250.sh │ │ ├── coach_rnn_gen50.sh │ │ ├── coach_rnn_gen500.sh │ │ ├── executor_bow.sh │ │ ├── executor_onehot.sh │ │ ├── executor_rnn.sh │ │ ├── executor_rnn_nohist.sh │ │ └── executor_zero.sh │ ├── set_path.py │ ├── train_coach.py │ ├── train_executor.py │ └── utils.py ├── common_utils │ ├── __init__.py │ ├── assert_utils.py │ ├── global_consts.py │ ├── helper.py │ ├── logger.py │ ├── multi_counter.py │ ├── optim.py │ ├── parser.py │ └── result_stat.py └── process_dataset │ ├── .gitignore │ ├── README.md │ ├── common_utils │ ├── create_dataset.py │ ├── format_json.py │ ├── gen_state.py │ ├── play_replay.py │ ├── process_game.py │ ├── process_instruction.py │ ├── process_json.py │ └── utils.py ├── third_party ├── CMakeLists.txt ├── Selene │ ├── .travis.yml │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── include │ │ ├── selene.h │ │ └── selene │ │ │ ├── BaseFun.h │ │ │ ├── Class.h │ │ │ ├── ClassFun.h │ │ │ ├── Ctor.h │ │ │ ├── Dtor.h │ │ │ ├── ExceptionHandler.h │ │ │ ├── ExceptionTypes.h │ │ │ ├── Fun.h │ │ │ ├── LuaName.h │ │ │ ├── LuaRef.h │ │ │ ├── MetatableRegistry.h │ │ │ ├── Obj.h │ │ │ ├── ObjFun.h │ │ │ ├── Registry.h │ │ │ ├── ResourceHandler.h │ │ │ ├── Selector.h │ │ │ ├── State.h │ │ │ ├── Tuple.h │ │ │ ├── function.h │ │ │ ├── primitives.h │ │ │ ├── references.h │ │ │ ├── traits.h │ │ │ └── util.h │ ├── selene.h │ └── test │ │ ├── Test.cpp │ │ ├── class_tests.h │ │ ├── common │ │ └── lifetime.h │ │ ├── error_tests.h │ │ ├── exception_tests.h │ │ ├── interop_tests.h │ │ ├── metatable_tests.h │ │ ├── obj_tests.h │ │ ├── reference_tests.h │ │ ├── selector_tests.h │ │ ├── test.lua │ │ ├── test_class.lua │ │ ├── test_error.lua │ │ ├── test_exceptions.lua │ │ ├── test_gc.lua │ │ ├── test_metatable.lua │ │ ├── test_ref.lua │ │ └── test_syntax_error.lua └── asio │ ├── LICENSE-asio │ ├── asio.hpp │ └── asio │ ├── async_result.hpp │ ├── basic_datagram_socket.hpp │ ├── basic_deadline_timer.hpp │ ├── basic_io_object.hpp │ ├── basic_raw_socket.hpp │ ├── basic_seq_packet_socket.hpp │ ├── basic_serial_port.hpp │ ├── basic_signal_set.hpp │ ├── basic_socket.hpp │ ├── basic_socket_acceptor.hpp │ ├── basic_socket_iostream.hpp │ ├── basic_socket_streambuf.hpp │ ├── basic_stream_socket.hpp │ ├── basic_streambuf.hpp │ ├── basic_streambuf_fwd.hpp │ ├── basic_waitable_timer.hpp │ ├── buffer.hpp │ ├── buffered_read_stream.hpp │ ├── buffered_read_stream_fwd.hpp │ ├── buffered_stream.hpp │ ├── buffered_stream_fwd.hpp │ ├── buffered_write_stream.hpp │ ├── buffered_write_stream_fwd.hpp │ ├── buffers_iterator.hpp │ ├── completion_condition.hpp │ ├── connect.hpp │ ├── coroutine.hpp │ ├── datagram_socket_service.hpp │ ├── deadline_timer.hpp │ ├── deadline_timer_service.hpp │ ├── detail │ ├── addressof.hpp │ ├── array.hpp │ ├── array_fwd.hpp │ ├── assert.hpp │ ├── atomic_count.hpp │ ├── base_from_completion_cond.hpp │ ├── bind_handler.hpp │ ├── buffer_resize_guard.hpp │ ├── buffer_sequence_adapter.hpp │ ├── buffered_stream_storage.hpp │ ├── call_stack.hpp │ ├── chrono_time_traits.hpp │ ├── completion_handler.hpp │ ├── config.hpp │ ├── consuming_buffers.hpp │ ├── cstdint.hpp │ ├── date_time_fwd.hpp │ ├── deadline_timer_service.hpp │ ├── dependent_type.hpp │ ├── descriptor_ops.hpp │ ├── descriptor_read_op.hpp │ ├── descriptor_write_op.hpp │ ├── dev_poll_reactor.hpp │ ├── epoll_reactor.hpp │ ├── event.hpp │ ├── eventfd_select_interrupter.hpp │ ├── fd_set_adapter.hpp │ ├── fenced_block.hpp │ ├── function.hpp │ ├── gcc_arm_fenced_block.hpp │ ├── gcc_hppa_fenced_block.hpp │ ├── gcc_sync_fenced_block.hpp │ ├── gcc_x86_fenced_block.hpp │ ├── handler_alloc_helpers.hpp │ ├── handler_cont_helpers.hpp │ ├── handler_invoke_helpers.hpp │ ├── handler_tracking.hpp │ ├── handler_type_requirements.hpp │ ├── hash_map.hpp │ ├── impl │ │ ├── buffer_sequence_adapter.ipp │ │ ├── descriptor_ops.ipp │ │ ├── dev_poll_reactor.hpp │ │ ├── dev_poll_reactor.ipp │ │ ├── epoll_reactor.hpp │ │ ├── epoll_reactor.ipp │ │ ├── eventfd_select_interrupter.ipp │ │ ├── handler_tracking.ipp │ │ ├── kqueue_reactor.hpp │ │ ├── kqueue_reactor.ipp │ │ ├── pipe_select_interrupter.ipp │ │ ├── posix_event.ipp │ │ ├── posix_mutex.ipp │ │ ├── posix_thread.ipp │ │ ├── posix_tss_ptr.ipp │ │ ├── reactive_descriptor_service.ipp │ │ ├── reactive_serial_port_service.ipp │ │ ├── reactive_socket_service_base.ipp │ │ ├── resolver_service_base.ipp │ │ ├── select_reactor.hpp │ │ ├── select_reactor.ipp │ │ ├── service_registry.hpp │ │ ├── service_registry.ipp │ │ ├── signal_set_service.ipp │ │ ├── socket_ops.ipp │ │ ├── socket_select_interrupter.ipp │ │ ├── strand_service.hpp │ │ ├── strand_service.ipp │ │ ├── task_io_service.hpp │ │ ├── task_io_service.ipp │ │ ├── throw_error.ipp │ │ ├── timer_queue_ptime.ipp │ │ ├── timer_queue_set.ipp │ │ ├── win_event.ipp │ │ ├── win_iocp_handle_service.ipp │ │ ├── win_iocp_io_service.hpp │ │ ├── win_iocp_io_service.ipp │ │ ├── win_iocp_serial_port_service.ipp │ │ ├── win_iocp_socket_service_base.ipp │ │ ├── win_mutex.ipp │ │ ├── win_object_handle_service.ipp │ │ ├── win_static_mutex.ipp │ │ ├── win_thread.ipp │ │ ├── win_tss_ptr.ipp │ │ ├── winrt_ssocket_service_base.ipp │ │ ├── winrt_timer_scheduler.hpp │ │ ├── winrt_timer_scheduler.ipp │ │ └── winsock_init.ipp │ ├── io_control.hpp │ ├── keyword_tss_ptr.hpp │ ├── kqueue_reactor.hpp │ ├── limits.hpp │ ├── local_free_on_block_exit.hpp │ ├── macos_fenced_block.hpp │ ├── mutex.hpp │ ├── noncopyable.hpp │ ├── null_event.hpp │ ├── null_fenced_block.hpp │ ├── null_mutex.hpp │ ├── null_reactor.hpp │ ├── null_signal_blocker.hpp │ ├── null_socket_service.hpp │ ├── null_static_mutex.hpp │ ├── null_thread.hpp │ ├── null_tss_ptr.hpp │ ├── object_pool.hpp │ ├── old_win_sdk_compat.hpp │ ├── op_queue.hpp │ ├── operation.hpp │ ├── pipe_select_interrupter.hpp │ ├── pop_options.hpp │ ├── posix_event.hpp │ ├── posix_fd_set_adapter.hpp │ ├── posix_mutex.hpp │ ├── posix_signal_blocker.hpp │ ├── posix_static_mutex.hpp │ ├── posix_thread.hpp │ ├── posix_tss_ptr.hpp │ ├── push_options.hpp │ ├── reactive_descriptor_service.hpp │ ├── reactive_null_buffers_op.hpp │ ├── reactive_serial_port_service.hpp │ ├── reactive_socket_accept_op.hpp │ ├── reactive_socket_connect_op.hpp │ ├── reactive_socket_recv_op.hpp │ ├── reactive_socket_recvfrom_op.hpp │ ├── reactive_socket_recvmsg_op.hpp │ ├── reactive_socket_send_op.hpp │ ├── reactive_socket_sendto_op.hpp │ ├── reactive_socket_service.hpp │ ├── reactive_socket_service_base.hpp │ ├── reactor.hpp │ ├── reactor_fwd.hpp │ ├── reactor_op.hpp │ ├── reactor_op_queue.hpp │ ├── regex_fwd.hpp │ ├── resolve_endpoint_op.hpp │ ├── resolve_op.hpp │ ├── resolver_service.hpp │ ├── resolver_service_base.hpp │ ├── scoped_lock.hpp │ ├── scoped_ptr.hpp │ ├── select_interrupter.hpp │ ├── select_reactor.hpp │ ├── service_registry.hpp │ ├── shared_ptr.hpp │ ├── signal_blocker.hpp │ ├── signal_handler.hpp │ ├── signal_init.hpp │ ├── signal_op.hpp │ ├── signal_set_service.hpp │ ├── socket_holder.hpp │ ├── socket_ops.hpp │ ├── socket_option.hpp │ ├── socket_select_interrupter.hpp │ ├── socket_types.hpp │ ├── solaris_fenced_block.hpp │ ├── static_mutex.hpp │ ├── std_event.hpp │ ├── std_mutex.hpp │ ├── std_static_mutex.hpp │ ├── std_thread.hpp │ ├── strand_service.hpp │ ├── task_io_service.hpp │ ├── task_io_service_operation.hpp │ ├── task_io_service_thread_info.hpp │ ├── thread.hpp │ ├── thread_info_base.hpp │ ├── throw_error.hpp │ ├── throw_exception.hpp │ ├── timer_queue.hpp │ ├── timer_queue_base.hpp │ ├── timer_queue_ptime.hpp │ ├── timer_queue_set.hpp │ ├── timer_scheduler.hpp │ ├── timer_scheduler_fwd.hpp │ ├── tss_ptr.hpp │ ├── type_traits.hpp │ ├── variadic_templates.hpp │ ├── wait_handler.hpp │ ├── wait_op.hpp │ ├── weak_ptr.hpp │ ├── win_event.hpp │ ├── win_fd_set_adapter.hpp │ ├── win_fenced_block.hpp │ ├── win_iocp_handle_read_op.hpp │ ├── win_iocp_handle_service.hpp │ ├── win_iocp_handle_write_op.hpp │ ├── win_iocp_io_service.hpp │ ├── win_iocp_null_buffers_op.hpp │ ├── win_iocp_operation.hpp │ ├── win_iocp_overlapped_op.hpp │ ├── win_iocp_overlapped_ptr.hpp │ ├── win_iocp_serial_port_service.hpp │ ├── win_iocp_socket_accept_op.hpp │ ├── win_iocp_socket_connect_op.hpp │ ├── win_iocp_socket_recv_op.hpp │ ├── win_iocp_socket_recvfrom_op.hpp │ ├── win_iocp_socket_recvmsg_op.hpp │ ├── win_iocp_socket_send_op.hpp │ ├── win_iocp_socket_service.hpp │ ├── win_iocp_socket_service_base.hpp │ ├── win_iocp_thread_info.hpp │ ├── win_mutex.hpp │ ├── win_object_handle_service.hpp │ ├── win_static_mutex.hpp │ ├── win_thread.hpp │ ├── win_tss_ptr.hpp │ ├── winapi_thread.hpp │ ├── winrt_async_manager.hpp │ ├── winrt_async_op.hpp │ ├── winrt_resolve_op.hpp │ ├── winrt_resolver_service.hpp │ ├── winrt_socket_connect_op.hpp │ ├── winrt_socket_recv_op.hpp │ ├── winrt_socket_send_op.hpp │ ├── winrt_ssocket_service.hpp │ ├── winrt_ssocket_service_base.hpp │ ├── winrt_timer_scheduler.hpp │ ├── winrt_utils.hpp │ ├── winsock_init.hpp │ └── wrapped_handler.hpp │ ├── error.hpp │ ├── error_code.hpp │ ├── generic │ ├── basic_endpoint.hpp │ ├── datagram_protocol.hpp │ ├── detail │ │ ├── endpoint.hpp │ │ └── impl │ │ │ └── endpoint.ipp │ ├── raw_protocol.hpp │ ├── seq_packet_protocol.hpp │ └── stream_protocol.hpp │ ├── handler_alloc_hook.hpp │ ├── handler_continuation_hook.hpp │ ├── handler_invoke_hook.hpp │ ├── handler_type.hpp │ ├── high_resolution_timer.hpp │ ├── impl │ ├── buffered_read_stream.hpp │ ├── buffered_write_stream.hpp │ ├── connect.hpp │ ├── error.ipp │ ├── error_code.ipp │ ├── handler_alloc_hook.ipp │ ├── io_service.hpp │ ├── io_service.ipp │ ├── read.hpp │ ├── read_at.hpp │ ├── read_until.hpp │ ├── serial_port_base.hpp │ ├── serial_port_base.ipp │ ├── spawn.hpp │ ├── src.cpp │ ├── src.hpp │ ├── use_future.hpp │ ├── write.hpp │ └── write_at.hpp │ ├── io_service.hpp │ ├── ip │ ├── address.hpp │ ├── address_v4.hpp │ ├── address_v6.hpp │ ├── basic_endpoint.hpp │ ├── basic_resolver.hpp │ ├── basic_resolver_entry.hpp │ ├── basic_resolver_iterator.hpp │ ├── basic_resolver_query.hpp │ ├── detail │ │ ├── endpoint.hpp │ │ ├── impl │ │ │ └── endpoint.ipp │ │ └── socket_option.hpp │ ├── host_name.hpp │ ├── icmp.hpp │ ├── impl │ │ ├── address.hpp │ │ ├── address.ipp │ │ ├── address_v4.hpp │ │ ├── address_v4.ipp │ │ ├── address_v6.hpp │ │ ├── address_v6.ipp │ │ ├── basic_endpoint.hpp │ │ └── host_name.ipp │ ├── multicast.hpp │ ├── resolver_query_base.hpp │ ├── resolver_service.hpp │ ├── tcp.hpp │ ├── udp.hpp │ ├── unicast.hpp │ └── v6_only.hpp │ ├── is_read_buffered.hpp │ ├── is_write_buffered.hpp │ ├── local │ ├── basic_endpoint.hpp │ ├── connect_pair.hpp │ ├── datagram_protocol.hpp │ ├── detail │ │ ├── endpoint.hpp │ │ └── impl │ │ │ └── endpoint.ipp │ └── stream_protocol.hpp │ ├── placeholders.hpp │ ├── posix │ ├── basic_descriptor.hpp │ ├── basic_stream_descriptor.hpp │ ├── descriptor_base.hpp │ ├── stream_descriptor.hpp │ └── stream_descriptor_service.hpp │ ├── raw_socket_service.hpp │ ├── read.hpp │ ├── read_at.hpp │ ├── read_until.hpp │ ├── seq_packet_socket_service.hpp │ ├── serial_port.hpp │ ├── serial_port_base.hpp │ ├── serial_port_service.hpp │ ├── signal_set.hpp │ ├── signal_set_service.hpp │ ├── socket_acceptor_service.hpp │ ├── socket_base.hpp │ ├── spawn.hpp │ ├── ssl.hpp │ ├── steady_timer.hpp │ ├── strand.hpp │ ├── stream_socket_service.hpp │ ├── streambuf.hpp │ ├── system_error.hpp │ ├── system_timer.hpp │ ├── thread.hpp │ ├── time_traits.hpp │ ├── unyield.hpp │ ├── use_future.hpp │ ├── version.hpp │ ├── wait_traits.hpp │ ├── waitable_timer_service.hpp │ ├── windows │ ├── basic_handle.hpp │ ├── basic_object_handle.hpp │ ├── basic_random_access_handle.hpp │ ├── basic_stream_handle.hpp │ ├── object_handle.hpp │ ├── object_handle_service.hpp │ ├── overlapped_ptr.hpp │ ├── random_access_handle.hpp │ ├── random_access_handle_service.hpp │ ├── stream_handle.hpp │ └── stream_handle_service.hpp │ ├── write.hpp │ ├── write_at.hpp │ └── yield.hpp ├── tube ├── CMakeLists.txt ├── README.md ├── pytube │ ├── __init__.py │ ├── data_channel_manager.py │ ├── test_dc_manager.py │ └── utils.py └── src_cpp │ ├── context.h │ ├── data_block.h │ ├── data_channel.cc │ ├── data_channel.h │ ├── dispatcher.h │ ├── env_thread.h │ ├── episodic_trajectory.h │ ├── fixed_len_trajectory.h │ ├── indefinite_trajectory.h │ ├── pybind.cc │ ├── test │ ├── test_data_channel.cc │ └── test_producer.h │ └── utils.h └── visual ├── .gitignore ├── README.md ├── gen_file_list.py ├── package.json ├── public ├── assets │ ├── blue │ │ ├── barrack.png │ │ ├── base.png │ │ ├── cannon.png │ │ ├── cavalry.png │ │ ├── defense_tower.png │ │ ├── engineer.png │ │ ├── factory.png │ │ ├── flight.png │ │ ├── hangar.png │ │ ├── resource.png │ │ ├── scifiUnit_05.png │ │ ├── scifiUnit_06.png │ │ ├── scifiUnit_07.png │ │ ├── scifiUnit_09.png │ │ ├── scifiUnit_10.png │ │ ├── soldier.png │ │ ├── spaceman.png │ │ ├── spearman.png │ │ ├── tank.png │ │ ├── tower.png │ │ ├── truck.png │ │ ├── worker.png │ │ └── workshop.png │ ├── medieval │ │ ├── blue │ │ │ ├── archer.png │ │ │ ├── archer_attack.png │ │ │ ├── archery.png │ │ │ ├── archery_build.png │ │ │ ├── aviary.png │ │ │ ├── aviary_build.png │ │ │ ├── barrack.png │ │ │ ├── barrack_build.png │ │ │ ├── blacksmith.png │ │ │ ├── blacksmith_build.png │ │ │ ├── catapult.png │ │ │ ├── catapult_attack.png │ │ │ ├── cavalry.png │ │ │ ├── cavalry_attack.png │ │ │ ├── coin.png │ │ │ ├── dragon.png │ │ │ ├── dragon_attack.png │ │ │ ├── guard_tower.png │ │ │ ├── guard_tower_build.png │ │ │ ├── na.png │ │ │ ├── peasant.png │ │ │ ├── peasant_attack.png │ │ │ ├── resource.png │ │ │ ├── spearman.png │ │ │ ├── spearman_attack.png │ │ │ ├── stable.png │ │ │ ├── stable_build.png │ │ │ ├── swordman.png │ │ │ ├── swordman_attack.png │ │ │ ├── town_hall.png │ │ │ ├── town_hall_build.png │ │ │ ├── workshop.png │ │ │ └── workshop_build.png │ │ └── red │ │ │ ├── archer.png │ │ │ ├── archer_attack.png │ │ │ ├── archery.png │ │ │ ├── archery_build.png │ │ │ ├── aviary.png │ │ │ ├── aviary_build.png │ │ │ ├── barrack.png │ │ │ ├── barrack_build.png │ │ │ ├── blacksmith.png │ │ │ ├── blacksmith_build.png │ │ │ ├── catapult.png │ │ │ ├── catapult_attack.png │ │ │ ├── cavalry.png │ │ │ ├── cavalry_attack.png │ │ │ ├── coin.png │ │ │ ├── dragon.png │ │ │ ├── dragon_attack.png │ │ │ ├── guard_tower.png │ │ │ ├── guard_tower_build.png │ │ │ ├── na.png │ │ │ ├── peasant.png │ │ │ ├── peasant_attack.png │ │ │ ├── resource.png │ │ │ ├── spearman.png │ │ │ ├── spearman_attack.png │ │ │ ├── stable.png │ │ │ ├── stable_build.png │ │ │ ├── swordman.png │ │ │ ├── swordman_attack.png │ │ │ ├── town_hall.png │ │ │ ├── town_hall_build.png │ │ │ ├── workshop.png │ │ │ └── workshop_build.png │ ├── red │ │ ├── barrack.png │ │ ├── base.png │ │ ├── cannon.png │ │ ├── cavalry.png │ │ ├── defense_tower.png │ │ ├── engineer.png │ │ ├── factory.png │ │ ├── flight.png │ │ ├── hangar.png │ │ ├── resource.png │ │ ├── scifiUnit_17.png │ │ ├── scifiUnit_18.png │ │ ├── scifiUnit_19.png │ │ ├── scifiUnit_21.png │ │ ├── scifiUnit_22.png │ │ ├── soldier.png │ │ ├── spaceman.png │ │ ├── spearman.png │ │ ├── tank.png │ │ ├── tower.png │ │ ├── truck.png │ │ ├── worker.png │ │ └── workshop.png │ └── terrain │ │ ├── fog.png │ │ ├── forest.png │ │ ├── grass.png │ │ ├── ground.png │ │ ├── killed_forest.png │ │ ├── mineral.png │ │ ├── na.png │ │ ├── rock.png │ │ ├── sand.png │ │ ├── soil.png │ │ ├── stump.png │ │ └── water.png ├── favicon.ico ├── index.html └── manifest.json └── src ├── App.css ├── App.js ├── App.test.js ├── Grid.js ├── MapCanvas.js ├── Unit.js ├── Util.js ├── index.css ├── index.js ├── logo.svg └── serviceWorker.js /.clang-format: -------------------------------------------------------------------------------- 1 | AccessModifierOffset: -1 2 | AllowShortFunctionsOnASingleLine: false 3 | AllowShortIfStatementsOnASingleLine: false 4 | AllowShortLoopsOnASingleLine: false 5 | BinPackParameters: false 6 | BinPackArguments: false 7 | BreakConstructorInitializersBeforeComma: true 8 | PenaltyBreakBeforeFirstCallParameter: 0 9 | PenaltyReturnTypeOnItsOwnLine: 200 10 | PointerBindsToType: true 11 | SpacesBeforeTrailingComments: 2 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build and interpreter artifacts 2 | *.a 3 | *.bin 4 | *.dSYM 5 | *.o 6 | *.pyc 7 | *.so 8 | build/ 9 | data/* 10 | !data/download.sh 11 | pretrained_models/* 12 | !pretrained_models/download.sh 13 | !pretrained_models/update_path.py 14 | __pycache__/ 15 | *.ropeproject 16 | 17 | # Random junk 18 | *.sw? 19 | *.db 20 | *.json 21 | *.sgf 22 | *.swo 23 | *.tree 24 | .codemod.bookmark 25 | .nfs* 26 | tmp*.sh 27 | tags 28 | build/ 29 | save_dir*/ 30 | test-*/ 31 | Testing/ 32 | pachi-*/ 33 | experimental/patterns.prob 34 | experimental/patterns.spat 35 | add_header.sh 36 | copy_right.py 37 | data2.tgz 38 | data2/ 39 | apache 40 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/pybind11"] 2 | path = third_party/pybind11 3 | url = git@github.com:pybind/pybind11.git 4 | [submodule "third_party/json"] 5 | path = third_party/json 6 | url = git@github.com:nlohmann/json.git 7 | [submodule "third_party/websocketpp"] 8 | path = third_party/websocketpp 9 | url = git@github.com:zaphoyd/websocketpp.git 10 | [submodule "third_party/concurrentqueue"] 11 | path = third_party/concurrentqueue 12 | url = git@github.com:cameron314/concurrentqueue.git 13 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 3.3) 2 | project(rts) 3 | add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) 4 | 5 | set(CMAKE_CXX_STANDARD 14) 6 | set(CMAKE_CXX_FLAGS 7 | "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -Wno-register -fPIC -march=native -Wfatal-errors -g") 8 | 9 | # execute_process( 10 | # COMMAND python -c "import torch; import os; print(os.path.dirname(torch.__file__), end='')" 11 | # OUTPUT_VARIABLE TorchPath 12 | # ) 13 | # set(CMAKE_PREFIX_PATH ${TorchPath}) 14 | # find_package(Torch REQUIRED) 15 | # set(TORCH_PYTHON_LIBRARIES "${TorchPath}/lib/libtorch_python.so") 16 | # get and append paths for finding dep 17 | 18 | execute_process( 19 | COMMAND python -c "import torch; import os; print(os.path.dirname(torch.__file__), end='')" 20 | OUTPUT_VARIABLE TORCH_PATH 21 | ) 22 | list(APPEND CMAKE_PREFIX_PATH ${TORCH_PATH}) 23 | find_package(Torch REQUIRED) 24 | set(TORCH_PYTHON_LIBRARIES "${TORCH_PATH}/lib/libtorch_python.so") 25 | 26 | add_subdirectory(third_party/pybind11) 27 | add_subdirectory(tube) 28 | include_directories(tube/src_cpp) 29 | 30 | add_subdirectory(game) 31 | 32 | add_subdirectory(third_party) 33 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | Facebook has adopted a Code of Conduct that we expect project participants to adhere to. 4 | Please read the [full text](https://code.fb.com/codeofconduct/) 5 | so that you can understand what actions will and will not be tolerated. 6 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to minirts 2 | We want to make contributing to this project as easy and transparent as 3 | possible. 4 | 5 | ## Our Development Process 6 | ... (in particular how this is synced with internal changes to the project) 7 | 8 | ## Contributor License Agreement ("CLA") 9 | In order to accept your pull request, we need you to submit a CLA. You only need 10 | to do this once to work on any of Facebook's open source projects. 11 | 12 | Complete your CLA here: 13 | 14 | ## Issues 15 | We use GitHub issues to track public bugs. Please ensure your description is 16 | clear and has sufficient instructions to be able to reproduce the issue. 17 | 18 | Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe 19 | disclosure of security bugs. In those cases, please go through the process 20 | outlined on that page and do not file a public issue. 21 | 22 | ## License 23 | By contributing to minirts, you agree that your contributions will be licensed 24 | under the LICENSE file in the root directory of this source tree. -------------------------------------------------------------------------------- /data/download.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | wget https://dl.fbaipublicfiles.com/minirts/data.tgz 8 | echo "extracting files, this may take a while" 9 | tar -zxf data.tgz 10 | echo "done!" 11 | echo "creating a symlink at visual/public" 12 | pwd=$(pwd) 13 | ln -s $(pwd)/replays_json ../visual/public/data 14 | -------------------------------------------------------------------------------- /game/.gitignore: -------------------------------------------------------------------------------- 1 | *.gen.h 2 | build 3 | elf 4 | -------------------------------------------------------------------------------- /game/ai/ai_factory.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #include "ai_factory.h" 8 | 9 | std::map AIFactory::_factories; 10 | -------------------------------------------------------------------------------- /game/engine/cmd.def: -------------------------------------------------------------------------------- 1 | CMD_START(100); 2 | 3 | CMD_IMMEDIATE(TacticalMove, PointF, p); 4 | CMD_IMMEDIATE( 5 | Create, 6 | UnitType, build_type, 7 | PointF, p, 8 | PlayerId, player_id, 9 | int, resource_used = 0, 10 | int, expiration = -1 11 | ); 12 | 13 | CMD_IMMEDIATE(Remove); 14 | CMD_IMMEDIATE(EmitBullet, UnitId, target, PointF, p, int, att, float, speed); 15 | CMD_IMMEDIATE(SaveMap, std::string, s); 16 | CMD_IMMEDIATE(LoadMap, std::string, s); 17 | CMD_IMMEDIATE(RandomSeed, int, seed); 18 | CMD_IMMEDIATE(Comment, std::string, comment); 19 | CMD_IMMEDIATE(CDStart, CDType, cd_type); 20 | 21 | CMD_CONTROL(FreezeGame, bool, freeze); 22 | -------------------------------------------------------------------------------- /game/engine/cmd_specific.def: -------------------------------------------------------------------------------- 1 | CMD_START(200); 2 | 3 | CMD_DURATIVE( 4 | Attack, 5 | UnitId, target 6 | ); 7 | 8 | CMD_DURATIVE( 9 | Move, 10 | PointF, p 11 | ); 12 | 13 | CMD_DURATIVE( 14 | Build, 15 | UnitType, build_type, 16 | PointF, p = PointF(), 17 | int, state = 0, 18 | bool, money_deducted=false 19 | ); 20 | 21 | CMD_DURATIVE( 22 | Gather, 23 | UnitId, town_hall, 24 | UnitId, resource, 25 | float, scale = 1.0, 26 | int, state = 0 27 | ); 28 | 29 | CMD_IMMEDIATE(MeleeAttack, UnitId, target, int, att); 30 | CMD_IMMEDIATE(OnDeadUnit, UnitId, target); 31 | CMD_IMMEDIATE(Harvest, UnitId, target, int, delta); 32 | CMD_IMMEDIATE(ChangePlayerResource, PlayerId, player_id, int, delta); 33 | 34 | CMD_CONTROL( 35 | IssueInstruction, 36 | PlayerId, player_id, 37 | std::string, instruction, 38 | bool, change_state = true); 39 | CMD_CONTROL(AcceptInstruction, PlayerId, player_id, std::string, instruction); 40 | CMD_CONTROL(FinishInstruction, PlayerId, player_id, std::string, instruction); 41 | CMD_CONTROL(InterruptInstruction, PlayerId, player_id, std::string, instruction); 42 | CMD_CONTROL(WarnInstruction, PlayerId, player_id); 43 | -------------------------------------------------------------------------------- /game/engine/const.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #pragma once 8 | 9 | const float kDistEps = 0.4; 10 | -------------------------------------------------------------------------------- /game/engine/game_action.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #include "engine/game_action.h" 8 | #include "engine/mc_rule_actor.h" 9 | 10 | bool RTSAction::Send(const GameEnv& env, CmdReceiver& receiver) { 11 | // TODO: temp fix, should move preload computation into action 12 | if (_type == ActionType::CMD_BASED) { 13 | MCRuleActor rule_actor(receiver, _player_id); 14 | // const Player& player = env.GetPlayer(_player_id); 15 | 16 | rule_actor.GatherInfo(env, std::list(), true); 17 | rule_actor.SetTowerAutoAttack(env, &_cmds); 18 | // rule_actor.SetAutoDefense(env, player, &_cmds); 19 | } 20 | return true; 21 | } 22 | -------------------------------------------------------------------------------- /game/engine/lua/cpp_interface.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #include "cpp_interface.h" 8 | 9 | void AttackRuleBook::Init(const std::string& lua_files) { 10 | init(lua_files, "attack_rule_book.lua"); 11 | } 12 | 13 | bool AttackRuleBook::CanAttack(UnitType unit, UnitType target) { 14 | bool ret = false; 15 | Invoke( 16 | "attack_rule_book", 17 | "can_attack", 18 | &ret, 19 | static_cast(unit), 20 | static_cast(target)); 21 | return ret; 22 | } 23 | 24 | void reg_engine_cpp_interfaces(const std::string& lua_files) { 25 | AttackRuleBook::Init(lua_files); 26 | } 27 | -------------------------------------------------------------------------------- /game/engine/lua/cpp_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #pragma once 8 | 9 | #include "utils/lua/interface.h" 10 | #include "engine/common.h" 11 | 12 | #include 13 | 14 | struct AttackRuleBook : public CppClassInterface { 15 | static void Init(const std::string& lua_files); 16 | 17 | static bool CanAttack(UnitType unit, UnitType target); 18 | }; 19 | 20 | void reg_engine_cpp_interfaces(const std::string& lua_files); 21 | -------------------------------------------------------------------------------- /game/engine/lua/utils.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #include "utils.h" 8 | 9 | #include "engine/cmd.gen.h" 10 | #include "engine/cmd_specific.gen.h" 11 | 12 | bool StateProxy::SendCmdCreate( 13 | int build_type, 14 | const PointF& p, 15 | int player_id, 16 | int resource_used) { 17 | return cmd_receiver_->SendCmd(CmdIPtr(new CmdCreate( 18 | INVALID, 19 | static_cast(build_type), 20 | p, 21 | static_cast(player_id), 22 | resource_used))); 23 | } 24 | 25 | bool StateProxy::SendCmdChangePlayerResource(int player_id, int delta) { 26 | return cmd_receiver_->SendCmd(CmdIPtr(new CmdChangePlayerResource( 27 | INVALID, static_cast(player_id), delta))); 28 | } 29 | -------------------------------------------------------------------------------- /game/engine/lua/utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #pragma once 8 | 9 | #include "engine/cmd_receiver.h" 10 | #include "engine/map.h" 11 | 12 | // Hack: Selene doesn't allow to pass more than 1 userdata param, see: 13 | // https://github.com/jeremyong/Selene/issues/140 14 | class StateProxy { 15 | private: 16 | RTSMap* map_; 17 | CmdReceiver* cmd_receiver_; 18 | 19 | public: 20 | StateProxy() = default; 21 | StateProxy(RTSMap* map, CmdReceiver* cmd_receiver) 22 | : map_(map), cmd_receiver_(cmd_receiver) {} 23 | // RTSMap commands 24 | int GetXSize() const { 25 | return map_->GetXSize(); 26 | } 27 | int GetYSize() const { 28 | return map_->GetYSize(); 29 | } 30 | int GetSlotType(int x, int y, int z) { 31 | return map_->GetSlotType(x, y, z); 32 | } 33 | void SetSlotType(int terrain_type, int x, int y, int z) { 34 | map_->SetSlotType(terrain_type, x, y, z); 35 | } 36 | // CmdReceiver commands 37 | bool SendCmdCreate( 38 | int build_type, 39 | const PointF& p, 40 | int player_id, 41 | int resource_used = 0); 42 | bool SendCmdChangePlayerResource(int player_id, int delta); 43 | }; 44 | 45 | struct AttackRules { 46 | bool CanAttack(UnitType unit, UnitType target); 47 | }; 48 | -------------------------------------------------------------------------------- /game/engine/rule_actor.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #include 8 | 9 | #include "gamedef.h" 10 | #include "rule_actor.h" 11 | #include "utils.h" 12 | 13 | bool RuleActor::store_cmd(const Unit* u, CmdBPtr&& cmd, AssignedCmds* m) const { 14 | assert(cmd.get() != nullptr); 15 | 16 | // at most one cmd per tick 17 | if (UnitHasCmd(u->GetId(), *m)) { 18 | return false; 19 | } 20 | 21 | (*m)[u->GetId()] = std::move(cmd); 22 | return true; 23 | } 24 | 25 | // void RuleActor::batch_store_cmds( 26 | // const std::vector& subset, 27 | // const CmdBPtr& cmd, 28 | // bool preemptive, 29 | // AssignedCmds* m) const { 30 | // for (const Unit* u : subset) { 31 | // const CmdDurative* curr_cmd = _receiver.GetUnitDurativeCmd(u->GetId()); 32 | // if (curr_cmd == nullptr || preemptive) { 33 | // store_cmd(u, cmd->clone(), m); 34 | // } 35 | // } 36 | // } 37 | 38 | bool RuleActor::GatherInfo(const GameEnv& env, 39 | const std::list& build_queue, 40 | bool respect_fow) { 41 | if (!_copied_preload) { 42 | _preload.GatherInfo(env, _player_id, _receiver, build_queue, respect_fow); 43 | } 44 | return _preload.Ok(); 45 | } 46 | -------------------------------------------------------------------------------- /game/frontend/imgs/14SAF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/14SAF.png -------------------------------------------------------------------------------- /game/frontend/imgs/2ebyiko.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/2ebyiko.png -------------------------------------------------------------------------------- /game/frontend/imgs/2eki549.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/2eki549.png -------------------------------------------------------------------------------- /game/frontend/imgs/Actor1_zps2890a1cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/Actor1_zps2890a1cd.png -------------------------------------------------------------------------------- /game/frontend/imgs/Actor2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/Actor2.png -------------------------------------------------------------------------------- /game/frontend/imgs/Christmas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/Christmas.png -------------------------------------------------------------------------------- /game/frontend/imgs/People3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/People3.png -------------------------------------------------------------------------------- /game/frontend/imgs/People4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/People4.png -------------------------------------------------------------------------------- /game/frontend/imgs/RTPkaihenn18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/RTPkaihenn18.png -------------------------------------------------------------------------------- /game/frontend/imgs/Spacece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/Spacece.png -------------------------------------------------------------------------------- /game/frontend/imgs/Sprites-Lunarea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/Sprites-Lunarea.png -------------------------------------------------------------------------------- /game/frontend/imgs/attack_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/attack_graph.png -------------------------------------------------------------------------------- /game/frontend/imgs/barracks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/barracks.png -------------------------------------------------------------------------------- /game/frontend/imgs/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/base.png -------------------------------------------------------------------------------- /game/frontend/imgs/building.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/building.png -------------------------------------------------------------------------------- /game/frontend/imgs/char_sample_zpsef814b4c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/char_sample_zpsef814b4c.png -------------------------------------------------------------------------------- /game/frontend/imgs/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/factory.png -------------------------------------------------------------------------------- /game/frontend/imgs/intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/intro.png -------------------------------------------------------------------------------- /game/frontend/imgs/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/items.png -------------------------------------------------------------------------------- /game/frontend/imgs/items_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/items_12.png -------------------------------------------------------------------------------- /game/frontend/imgs/mineral1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/mineral1.png -------------------------------------------------------------------------------- /game/frontend/imgs/tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/imgs/tiles.png -------------------------------------------------------------------------------- /game/frontend/media/door_bell.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/media/door_bell.mp3 -------------------------------------------------------------------------------- /game/frontend/rts/blue/barrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/barrack.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/base.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/cannon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/cannon.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/cavalry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/cavalry.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/defense_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/defense_tower.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/engineer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/engineer.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/factory.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/flight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/flight.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/hangar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/hangar.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/resource.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/scifiUnit_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/scifiUnit_05.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/scifiUnit_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/scifiUnit_06.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/scifiUnit_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/scifiUnit_07.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/scifiUnit_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/scifiUnit_09.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/scifiUnit_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/scifiUnit_10.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/soldier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/soldier.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/spaceman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/spaceman.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/spearman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/spearman.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/tank.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/tower.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/truck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/truck.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/worker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/worker.png -------------------------------------------------------------------------------- /game/frontend/rts/blue/workshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/blue/workshop.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/actions/accept.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/actions/accept.gif -------------------------------------------------------------------------------- /game/frontend/rts/medieval/actions/attack.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/actions/attack.gif -------------------------------------------------------------------------------- /game/frontend/rts/medieval/actions/build.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/actions/build.gif -------------------------------------------------------------------------------- /game/frontend/rts/medieval/actions/finish.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/actions/finish.gif -------------------------------------------------------------------------------- /game/frontend/rts/medieval/actions/gather.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/actions/gather.gif -------------------------------------------------------------------------------- /game/frontend/rts/medieval/actions/issue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/actions/issue.gif -------------------------------------------------------------------------------- /game/frontend/rts/medieval/actions/move.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/actions/move.gif -------------------------------------------------------------------------------- /game/frontend/rts/medieval/actions/stop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/actions/stop.gif -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/archer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/archer.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/archer_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/archer_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/archery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/archery.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/aviary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/aviary.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/barrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/barrack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/blacksmith.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/blacksmith.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/catapult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/catapult.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/catapult_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/catapult_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/cavalry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/cavalry.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/cavalry_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/cavalry_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/coin.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/dragon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/dragon.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/dragon_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/dragon_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/guard_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/guard_tower.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/peasant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/peasant.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/peasant_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/peasant_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/spearman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/spearman.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/spearman_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/spearman_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/stable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/stable.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/swordman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/swordman.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/swordman_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/swordman_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/town_hall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/town_hall.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/blue/workshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/blue/workshop.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/archer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/archer.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/archer_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/archer_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/archery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/archery.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/aviary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/aviary.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/barrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/barrack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/blacksmith.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/blacksmith.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/catapult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/catapult.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/catapult_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/catapult_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/cavalry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/cavalry.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/cavalry_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/cavalry_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/coin.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/dragon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/dragon.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/dragon_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/dragon_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/guard_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/guard_tower.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/peasant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/peasant.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/peasant_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/peasant_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/spearman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/spearman.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/spearman_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/spearman_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/stable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/stable.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/swordman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/swordman.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/swordman_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/swordman_attack.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/town_hall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/town_hall.png -------------------------------------------------------------------------------- /game/frontend/rts/medieval/red/workshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/medieval/red/workshop.png -------------------------------------------------------------------------------- /game/frontend/rts/red/barrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/barrack.png -------------------------------------------------------------------------------- /game/frontend/rts/red/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/base.png -------------------------------------------------------------------------------- /game/frontend/rts/red/cannon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/cannon.png -------------------------------------------------------------------------------- /game/frontend/rts/red/cavalry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/cavalry.png -------------------------------------------------------------------------------- /game/frontend/rts/red/defense_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/defense_tower.png -------------------------------------------------------------------------------- /game/frontend/rts/red/engineer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/engineer.png -------------------------------------------------------------------------------- /game/frontend/rts/red/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/factory.png -------------------------------------------------------------------------------- /game/frontend/rts/red/flight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/flight.png -------------------------------------------------------------------------------- /game/frontend/rts/red/hangar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/hangar.png -------------------------------------------------------------------------------- /game/frontend/rts/red/resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/resource.png -------------------------------------------------------------------------------- /game/frontend/rts/red/scifiUnit_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/scifiUnit_17.png -------------------------------------------------------------------------------- /game/frontend/rts/red/scifiUnit_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/scifiUnit_18.png -------------------------------------------------------------------------------- /game/frontend/rts/red/scifiUnit_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/scifiUnit_19.png -------------------------------------------------------------------------------- /game/frontend/rts/red/scifiUnit_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/scifiUnit_21.png -------------------------------------------------------------------------------- /game/frontend/rts/red/scifiUnit_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/scifiUnit_22.png -------------------------------------------------------------------------------- /game/frontend/rts/red/soldier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/soldier.png -------------------------------------------------------------------------------- /game/frontend/rts/red/spaceman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/spaceman.png -------------------------------------------------------------------------------- /game/frontend/rts/red/spearman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/spearman.png -------------------------------------------------------------------------------- /game/frontend/rts/red/tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/tank.png -------------------------------------------------------------------------------- /game/frontend/rts/red/tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/tower.png -------------------------------------------------------------------------------- /game/frontend/rts/red/truck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/truck.png -------------------------------------------------------------------------------- /game/frontend/rts/red/worker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/worker.png -------------------------------------------------------------------------------- /game/frontend/rts/red/workshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/red/workshop.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/fog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/fog.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/forest.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/grass.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/ground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/ground.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/killed_forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/killed_forest.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/rock.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/sand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/sand.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/soil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/soil.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/stump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/stump.png -------------------------------------------------------------------------------- /game/frontend/rts/terrain/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/game/frontend/rts/terrain/water.png -------------------------------------------------------------------------------- /game/game_MC/cmd_specific.def: -------------------------------------------------------------------------------- 1 | CMD_START(1000); 2 | 3 | # Generate a game map, with base and resource location. 4 | CMD_IMMEDIATE(GenerateMap, int, seed, bool, no_terrain); 5 | 6 | # Generate some units randomly on the map. 7 | CMD_IMMEDIATE(GenerateUnit, int, seed, int, resource, int, resource_dist, int, num_resources, bool, fair, int, num_peasants, int, num_extra_units); 8 | 9 | # Start the game from a predefined setup. Should be called after 10 | # GenerateMap and GenerateUnit 11 | CMD_IMMEDIATE(GameStartSpecific); 12 | -------------------------------------------------------------------------------- /game/game_MC/lua/attack_rule_book.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (c) Facebook, Inc. and its affiliates. 2 | -- All rights reserved. 3 | -- 4 | -- This source code is licensed under the license found in the 5 | -- LICENSE file in the root directory of this source tree. 6 | -- 7 | attack_rule_book = {} 8 | 9 | 10 | function attack_rule_book.can_attack(unit, target) 11 | if unit == UnitType.DRAGON then 12 | if target == UnitType.RANGE_ATTACKER then 13 | return false 14 | end 15 | return true 16 | end 17 | if unit == UnitType.MELEE_ATTACKER then 18 | if target == UnitType.DRAGON then 19 | return false 20 | end 21 | return true 22 | end 23 | if unit == UnitType.RANGE_ATTACKER then 24 | if target == UnitType.MELEE_ATTACKER then 25 | return false 26 | end 27 | return true 28 | end 29 | return true 30 | end 31 | -------------------------------------------------------------------------------- /game/game_MC/lua/lua_interface.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #include "lua_interface.h" 8 | 9 | namespace detail {} 10 | 11 | void reg_lua_interfaces() {} 12 | -------------------------------------------------------------------------------- /game/game_MC/lua/lua_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #pragma once 8 | 9 | #include "utils/lua/interface.h" 10 | 11 | #include "engine/common.h" 12 | #include "engine/map.h" 13 | 14 | namespace detail {} 15 | 16 | void reg_lua_interfaces(); 17 | -------------------------------------------------------------------------------- /game/game_MC/lua/random.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (c) Facebook, Inc. and its affiliates. 2 | -- All rights reserved. 3 | -- 4 | -- This source code is licensed under the license found in the 5 | -- LICENSE file in the root directory of this source tree. 6 | -- 7 | local random = {} 8 | 9 | -- generate random number from [min, max] (both inclusive) 10 | function random.get_rng(seed) 11 | local __seed = seed 12 | 13 | function fast_random(min, max) 14 | __seed = (__seed * 1009 + 9007) % 65537 15 | num = (__seed % (max - min + 1)) + min 16 | return num 17 | end 18 | 19 | return fast_random 20 | end 21 | 22 | return random 23 | -------------------------------------------------------------------------------- /game/utils/lua/common.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #pragma once 8 | 9 | namespace detail { 10 | 11 | struct NonCopyable { 12 | NonCopyable(const NonCopyable&) = delete; 13 | NonCopyable& operator=(const NonCopyable&) = delete; 14 | }; 15 | 16 | struct NonMovable { 17 | NonMovable(NonMovable&&) = delete; 18 | NonMovable&& operator=(NonMovable&&) = delete; 19 | }; 20 | 21 | } // namespace detail 22 | -------------------------------------------------------------------------------- /game/utils/lua/state_holder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #pragma once 8 | 9 | #include "common.h" 10 | #include "selene.h" 11 | 12 | class StateHolder : public detail::NonMovable, detail::NonCopyable { 13 | public: 14 | static sel::State& GetState() { 15 | // This initialization should be thread safe according to the standard. 16 | static thread_local sel::State state{true}; 17 | return state; 18 | } 19 | 20 | protected: 21 | StateHolder() = default; 22 | ~StateHolder() = default; 23 | }; 24 | -------------------------------------------------------------------------------- /install_apache.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | rm -rf apache 8 | mkdir apache 9 | cd apache 10 | 11 | SCRIPT=$(readlink -f "$0") 12 | SCRIPTPATH=$(dirname "$SCRIPT") 13 | echo $SCRIPTPATH 14 | 15 | mkdir apr 16 | mkdir apr_util 17 | mkdir httpd 18 | 19 | wget https://www-eu.apache.org/dist//apr/apr-1.7.0.tar.gz 20 | tar -zxf apr-1.7.0.tar.gz 21 | cd $SCRIPTPATH/apr-1.7.0 22 | ./configure --prefix=$SCRIPTPATH/apr 23 | make 24 | make install 25 | 26 | cd $SCRIPTPATH 27 | wget https://www-eu.apache.org/dist//apr/apr-util-1.6.1.tar.gz 28 | tar -zxf apr-util-1.6.1.tar.gz 29 | cd $SCRIPTPATH/apr-util-1.6.1 30 | ./configure --prefix=$SCRIPTPATH/apr_util --with-apr=$SCRIPTPATH/apr 31 | make 32 | make install 33 | 34 | cd $SCRIPTPATH 35 | wget https://www-us.apache.org/dist//httpd/httpd-2.4.41.tar.gz 36 | tar -zxf httpd-2.4.41.tar.gz 37 | cd $SCRIPTPATH/httpd-2.4.41 38 | ./configure --prefix=$SCRIPTPATH/httpd \ 39 | --with-apr=$SCRIPTPATH/apr \ 40 | --with-apr-util=$SCRIPTPATH/apr_util 41 | make 42 | make install 43 | -------------------------------------------------------------------------------- /pretrained_models/download.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | wget https://dl.fbaipublicfiles.com/minirts/models.tgz 8 | echo "extracting models" 9 | tar -zxf models.tgz 10 | echo "done!" 11 | -------------------------------------------------------------------------------- /pretrained_models/update_path.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | import os 8 | import pickle 9 | import pprint 10 | 11 | folder = os.path.abspath(os.path.dirname(__file__)) 12 | params = [f for f in os.listdir(folder) if f.endswith('pt.params')] 13 | 14 | inst_dict_path = os.path.join(os.path.dirname(folder), 'data', 'dataset', 'dict.pt') 15 | 16 | for p in params: 17 | param_dict = pickle.load(open(p, 'rb')) 18 | param_dict['args'].inst_dict_path = inst_dict_path 19 | # pprint.pprint(param_dict) 20 | pickle.dump(param_dict, open(p, 'wb')) 21 | -------------------------------------------------------------------------------- /scripts/README.md: -------------------------------------------------------------------------------- 1 | # Hierarchical Decision Making by Generating and Following Natural Language Instructions 2 | ## Supporting code 3 | 4 | ### Dependencies 5 | We implement our models in PyTorch 1.0.0, thus the following packages need to be installed: 6 | ``` 7 | pip intall ... 8 | ``` 9 | 10 | 11 | 12 | ### Dataset 13 | First, download `dataset.tar.gz` using http://bit.ly/2VL9lg6 and put in the root folder of this project. Then unpack it by running: 14 | ``` 15 | tar -xzf dataset.tar.gz 16 | ``` 17 | This will create the `dataset` folder, with the following files: 18 | ``` 19 | dict.pt # pickle archive of behavior_clone/inst_dict.py, which contains the words and instructions dictionaries. 20 | dev.json # a json dump of a small training dataset useful for debugging. 21 | train.json # a json dump of a large training dataset. 22 | val.json # a json dump of a validation dataset. 23 | ``` 24 | 25 | 26 | ### Training Executor Model 27 | 28 | 29 | ### Training Instructor Model 30 | 31 | ### Play against Rule-Based AI 32 | -------------------------------------------------------------------------------- /scripts/behavior_clone/.gitignore: -------------------------------------------------------------------------------- 1 | srun.sh 2 | *.pt 3 | *.log 4 | saved_models 5 | sweep_executor/* 6 | data 7 | data2 8 | data3 9 | model_arxiv 10 | matches 11 | sweep_coach 12 | matches2/ 13 | sweep_match/ 14 | -------------------------------------------------------------------------------- /scripts/behavior_clone/common_utils: -------------------------------------------------------------------------------- 1 | ../common_utils -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_bow250.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type bow \ 28 | --model_folder saved_models/coach_bow250 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 250 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 9 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_bow50.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type bow \ 28 | --model_folder saved_models/coach_bow50 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 50 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 9 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_bow500.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type bow \ 28 | --model_folder saved_models/coach_bow500 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 500 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 9 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_onehot250.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type onehot \ 28 | --model_folder saved_models/coach_onehot250 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 250 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 9 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_onehot50.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type onehot \ 28 | --model_folder saved_models/coach_onehot50 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 50 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 3 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_onehot500.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type onehot \ 28 | --model_folder saved_models/coach_onehot500 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 500 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 3 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_rnn250.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type rnn \ 28 | --model_folder saved_models/coach_rnn250 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 250 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 1 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_rnn50.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type rnn \ 28 | --model_folder saved_models/coach_rnn50 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 50 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 9 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_rnn500.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type rnn \ 28 | --model_folder saved_models/coach_rnn500 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 500 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 3 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_rnn_gen250.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type rnn_gen \ 28 | --model_folder saved_models/coach_rnn_gen250 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 250 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 1 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_rnn_gen50.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type rnn_gen \ 28 | --model_folder saved_models/coach_rnn_gen50 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 50 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 9 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/coach_rnn_gen500.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_coach.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 128 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.0 \ 21 | --word_emb_dim 128 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 256 \ 24 | --count_hid_dim 256 \ 25 | --count_hid_layers 2 \ 26 | --glob_dropout 0.5 \ 27 | --coach_type rnn_gen \ 28 | --model_folder saved_models/coach_rnn_gen500 \ 29 | --batch_size 100 \ 30 | --gpu 0 \ 31 | --grad_clip 0.5 \ 32 | --lr 0.002 \ 33 | --optim adamax \ 34 | --epochs 50 \ 35 | --num_pos_inst 500 \ 36 | --num_neg_inst 500 \ 37 | --pos_dim 16 \ 38 | --prev_cmd_rnn 1 \ 39 | --seed 3 \ 40 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/executor_bow.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_executor.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 256 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.1 \ 21 | --rnn_word_emb_dim 128 \ 22 | --word_emb_dropout 0.5 \ 23 | --inst_hid_dim 256 \ 24 | --inst_encoder_type bow \ 25 | --model_folder saved_models/executor_bow \ 26 | --batch_size 128 \ 27 | --gpu 0 \ 28 | --grad_clip 0.5 \ 29 | --lr 0.002 \ 30 | --optim adamax \ 31 | --epochs 50 \ 32 | --use_hist_inst 1 \ 33 | --pos_dim 16 \ 34 | --prev_cmd_rnn 1 \ 35 | --top_num_inst -1 \ 36 | --seed 9 \ 37 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/executor_onehot.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_executor.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 256 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.1 \ 21 | --rnn_word_emb_dim 128 \ 22 | --word_emb_dropout 0 \ 23 | --inst_hid_dim 128 \ 24 | --inst_encoder_type topn \ 25 | --model_folder saved_models/executor_onehot \ 26 | --batch_size 128 \ 27 | --gpu 0 \ 28 | --grad_clip 0.5 \ 29 | --lr 0.002 \ 30 | --optim adamax \ 31 | --epochs 50 \ 32 | --use_hist_inst 1 \ 33 | --pos_dim 16 \ 34 | --prev_cmd_rnn 1 \ 35 | --top_num_inst 1000 \ 36 | --seed 3 \ 37 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/executor_rnn.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_executor.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 256 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.1 \ 21 | --rnn_word_emb_dim 64 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 128 \ 24 | --inst_encoder_type lstm \ 25 | --model_folder saved_models/executor_rnn \ 26 | --batch_size 128 \ 27 | --gpu 0 \ 28 | --grad_clip 0.5 \ 29 | --lr 0.002 \ 30 | --optim adamax \ 31 | --epochs 50 \ 32 | --use_hist_inst 1 \ 33 | --pos_dim 16 \ 34 | --prev_cmd_rnn 1 \ 35 | --top_num_inst -1 \ 36 | --seed 1 \ 37 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/executor_rnn_nohist.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_executor.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 256 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.1 \ 21 | --rnn_word_emb_dim 64 \ 22 | --word_emb_dropout 0.25 \ 23 | --inst_hid_dim 128 \ 24 | --inst_encoder_type lstm \ 25 | --model_folder saved_models/executor_rnn_nohist \ 26 | --batch_size 128 \ 27 | --gpu 0 \ 28 | --grad_clip 0.5 \ 29 | --lr 0.002 \ 30 | --optim adamax \ 31 | --epochs 50 \ 32 | --use_hist_inst 0 \ 33 | --pos_dim 16 \ 34 | --prev_cmd_rnn 1 \ 35 | --top_num_inst -1 \ 36 | --seed 1 \ 37 | -------------------------------------------------------------------------------- /scripts/behavior_clone/scripts/executor_zero.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | #!/bin/bash 8 | python train_executor.py \ 9 | --train_dataset ../../data/dataset/train.json \ 10 | --val_dataset ../../data/dataset/val.json \ 11 | --inst_dict_path ../../data/dataset/dict.pt \ 12 | --emb_field_dim 32 \ 13 | --prev_cmd_dim 64 \ 14 | --num_conv_layers 3 \ 15 | --num_post_layers 1 \ 16 | --conv_hid_dim 256 \ 17 | --army_out_dim 256 \ 18 | --other_out_dim 128 \ 19 | --money_hid_layer 1 \ 20 | --conv_dropout 0.1 \ 21 | --rnn_word_emb_dim 128 \ 22 | --word_emb_dropout 0 \ 23 | --inst_hid_dim 128 \ 24 | --inst_encoder_type zero \ 25 | --model_folder saved_models/executor_zero \ 26 | --batch_size 128 \ 27 | --gpu 0 \ 28 | --grad_clip 0.5 \ 29 | --lr 0.002 \ 30 | --optim adamax \ 31 | --epochs 50 \ 32 | --use_hist_inst 0 \ 33 | --pos_dim 32 \ 34 | --prev_cmd_rnn 1 \ 35 | --top_num_inst -1 \ 36 | --seed 3 \ 37 | -------------------------------------------------------------------------------- /scripts/behavior_clone/set_path.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | import os 8 | import sys 9 | 10 | 11 | def append_sys_path(): 12 | root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 13 | 14 | tube = os.path.join(root, 'build', 'tube') 15 | if tube not in sys.path: 16 | sys.path.append(tube) 17 | 18 | pytube = os.path.join(root, 'tube') 19 | if pytube not in sys.path: 20 | sys.path.append(pytube) 21 | 22 | minirts = os.path.join(root, 'build', 'game') 23 | if minirts not in sys.path: 24 | sys.path.append(minirts) 25 | 26 | script = os.path.join(root, 'scripts') 27 | if script not in sys.path: 28 | sys.path.append(script) 29 | 30 | 31 | if __name__ == '__main__': 32 | # import env for testing 33 | append_sys_path() 34 | import torch 35 | import tube 36 | import pytube 37 | import minirts 38 | import behavior_clone 39 | -------------------------------------------------------------------------------- /scripts/common_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | from .assert_utils import * 8 | from .parser import Parser 9 | from .helper import * 10 | from .logger import * 11 | from .multi_counter import MultiCounter 12 | from .result_stat import ResultStat 13 | from .optim import Optim#, eval_mode_no_grad 14 | -------------------------------------------------------------------------------- /scripts/common_utils/assert_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | """Utils for assertions""" 8 | 9 | 10 | def assert_eq(real, expected): 11 | assert real == expected, '%s (true) vs %s (expected)' % (real, expected) 12 | 13 | 14 | def assert_neq(real, expected): 15 | assert real != expected, '%s (true) vs %s (expected)' % (real, expected) 16 | 17 | 18 | def assert_lt(real, expected): 19 | assert real < expected, '%s (true) vs %s (expected)' % (real, expected) 20 | 21 | 22 | def assert_lteq(real, expected): 23 | assert real <= expected, '%s (true) vs %s (expected)' % (real, expected) 24 | 25 | 26 | def assert_tensor_eq(t1, t2, eps=1e-6): 27 | if t1.size() != t2.size(): 28 | print('Warning: size mismatch', t1.size(), 'vs', t2.size()) 29 | return False 30 | 31 | t1 = t1.cpu().numpy() 32 | t2 = t2.cpu().numpy() 33 | diff = abs(t1 - t2) 34 | eq = (diff < eps).all() 35 | if not eq: 36 | import pdb 37 | pdb.set_trace() 38 | assert(eq) 39 | 40 | 41 | def assert_zero_grads(params): 42 | for p in params: 43 | if p.grad is not None: 44 | assert(p.grad.sum().item() == 0) 45 | -------------------------------------------------------------------------------- /scripts/common_utils/logger.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | import os 8 | import sys 9 | 10 | 11 | class Logger: 12 | def __init__(self, path, mode='w'): 13 | assert mode in {'w', 'a'}, 'unknown mode for logger %s' % mode 14 | self.terminal = sys.stdout 15 | if not os.path.exists(os.path.dirname(path)): 16 | os.makedirs(os.path.dirname(path)) 17 | if mode == 'w' or not os.path.exists(path): 18 | self.log = open(path, "w") 19 | else: 20 | self.log = open(path, "a") 21 | 22 | def write(self, message): 23 | self.terminal.write(message) 24 | self.log.write(message) 25 | self.log.flush() 26 | 27 | def flush(self): 28 | # for python 3 compatibility. 29 | pass 30 | -------------------------------------------------------------------------------- /scripts/common_utils/parser.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | import sys 8 | from collections import OrderedDict 9 | 10 | 11 | class Parser: 12 | def __init__(self): 13 | self.arg_parsers = OrderedDict() 14 | 15 | def add_parser(self, name, parser): 16 | if name in self.arg_parsers: 17 | print('Error: duplicate key for parser:', name) 18 | 19 | self.arg_parsers[name] = parser 20 | 21 | def parse(self): 22 | args = {} 23 | remain = sys.argv 24 | for name, parser in self.arg_parsers.items(): 25 | print('parsing:', name) 26 | arg, remain = parser.parse_known_args(args=remain) 27 | args[name] = arg 28 | 29 | if len(remain) > 1: 30 | print('Warning: extra key for parser:', remain) 31 | assert False 32 | 33 | return args 34 | 35 | def log(self): 36 | print(self.arg_parsers) 37 | -------------------------------------------------------------------------------- /scripts/process_dataset/.gitignore: -------------------------------------------------------------------------------- 1 | *.png -------------------------------------------------------------------------------- /scripts/process_dataset/common_utils: -------------------------------------------------------------------------------- 1 | ../common_utils -------------------------------------------------------------------------------- /scripts/process_dataset/play_replay.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | import os 8 | import sys 9 | import subprocess 10 | 11 | replay = sys.argv[1] 12 | lua_path = replay + '.lua' 13 | 14 | assert os.path.exists(replay) 15 | assert os.path.exists(lua_path) 16 | 17 | binary = os.path.abspath('../../build/minirts-backend') 18 | player1 = 'dummy,fs=1' 19 | player2 = 'dummy,fs=1' 20 | 21 | cmd = [ 22 | 'LUA_PATH=%s' % (os.path.join(lua_path, '?.lua')), 23 | binary, 24 | 'teamreplay', 25 | '--load_replay %s' % replay, 26 | '--players "%s;%s"' % (player1, player2), 27 | '--lua_files %s' % lua_path, 28 | '--max_tick %d' % 20000, 29 | '--vis_after %d' % 0, 30 | ] 31 | 32 | cmd = ' '.join(cmd) 33 | print(cmd) 34 | subprocess.run([cmd], shell=True) 35 | -------------------------------------------------------------------------------- /scripts/process_dataset/utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | import os 8 | 9 | 10 | def get_all_files(root, file_extension): 11 | files = [] 12 | for folder, _, fs in os.walk(root): 13 | for f in fs: 14 | if f.endswith(file_extension): 15 | files.append(os.path.join(folder, f)) 16 | return files 17 | -------------------------------------------------------------------------------- /third_party/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # add_subdirectory(json) 2 | add_library(json INTERFACE) 3 | target_include_directories(json SYSTEM INTERFACE 4 | json/single_include 5 | ) 6 | 7 | # asio library 8 | add_library(asio INTERFACE) 9 | target_include_directories(asio SYSTEM INTERFACE 10 | asio 11 | ) 12 | 13 | # websocketapp library 14 | add_library(websocketpp INTERFACE) 15 | target_include_directories(websocketpp SYSTEM INTERFACE 16 | websocketpp 17 | ) 18 | target_link_libraries(websocketpp INTERFACE asio) 19 | 20 | find_package(Lua REQUIRED) 21 | 22 | # selene library 23 | add_library(selene INTERFACE) 24 | target_include_directories(selene SYSTEM INTERFACE 25 | Selene 26 | ${LUA_INCLUDE_DIR} 27 | ) 28 | target_link_libraries(selene INTERFACE ${LUA_LIBRARIES}) 29 | # set_target_properties(selene PROPERTIES COMPILE_FLAGS "") 30 | 31 | add_library(concurrentqueue INTERFACE) 32 | target_include_directories(concurrentqueue INTERFACE 33 | concurrentqueue 34 | ) 35 | -------------------------------------------------------------------------------- /third_party/Selene/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | compiler: gcc 4 | 5 | before_install: 6 | - if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi 7 | - sudo apt-get update -qq 8 | 9 | install: 10 | - if [ "$CXX" = "g++" ]; then export PACKAGES_TO_INSTALL="g++-4.8"; fi 11 | - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8"; fi 12 | - export PACKAGES_TO_INSTALL="${PACKAGES_TO_INSTALL} lua5.2 liblua5.2-dev" 13 | - export PACKAGES_TO_INSTALL="${PACKAGES_TO_INSTALL} valgrind" 14 | - sudo apt-get install -qq ${PACKAGES_TO_INSTALL} 15 | - sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.2.so /usr/lib/liblua.so 16 | 17 | env: 18 | - BUILD_TYPE=Release 19 | - BUILD_TYPE=Debug VALGRIND='valgrind --leak-check=full --error-exitcode=1' 20 | 21 | script: 22 | - mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLUA_INCLUDE_DIR=/usr/include/lua5.2 && make && ${VALGRIND} ./test_runner 23 | -------------------------------------------------------------------------------- /third_party/Selene/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(Selene) 3 | 4 | set(LUA_PC_CFG "lua;lua5.3;lua5.2;lua5.1" CACHE STRING "pkg-config Lua configuration file (or files, separated by ;)") 5 | 6 | find_package(PkgConfig) 7 | if(PKG_CONFIG_EXECUTABLE) 8 | pkg_search_module(LUA REQUIRED ${LUA_PC_CFG}) 9 | else() 10 | if(NOT LUA_INCLUDE_DIR) 11 | message(SEND_ERROR "LUA_INCLUDE_DIR is required if no PkgConfig is available!") 12 | endif() 13 | if(NOT LUA_LIBRARIES) 14 | message(SEND_ERROR "LUA_LIBRARIES is required if no PkgConfig is available!") 15 | endif() 16 | endif() 17 | 18 | if(${LUA_INCLUDE_DIR}) 19 | if(NOT EXISTS ${LUA_INCLUDE_DIR}/lua.h) 20 | message(SEND_ERROR "Can't find lua.h in ${LUA_INCLUDE_DIR}") 21 | endif() 22 | endif() 23 | 24 | include_directories(${LUA_INCLUDE_DIR}) 25 | 26 | if(APPLE) 27 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -stdlib=libc++") 28 | elseif(UNIX) 29 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11") 30 | elseif(WIN32) 31 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11") 32 | endif(APPLE) 33 | 34 | include_directories(include) 35 | file(GLOB headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 36 | include/*.h include/selene/*.h) 37 | 38 | add_executable(test_runner ${CMAKE_CURRENT_SOURCE_DIR}/test/Test.cpp) 39 | target_link_libraries(test_runner ${LUA_LIBRARIES}) 40 | -------------------------------------------------------------------------------- /third_party/Selene/LICENSE: -------------------------------------------------------------------------------- 1 | The Zlib License 2 | 3 | Copyright (c) 2013 Jeremy Ong 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | -------------------------------------------------------------------------------- /third_party/Selene/include/selene.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(_MSC_VER) && _MSC_VER < 1900 // before MSVS-14 CTP1 4 | #define constexpr const 5 | #endif 6 | 7 | #include "selene/State.h" 8 | #include "selene/Tuple.h" 9 | -------------------------------------------------------------------------------- /third_party/Selene/include/selene/Ctor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "BaseFun.h" 4 | 5 | namespace sel { 6 | 7 | template 8 | class Ctor : public BaseFun { 9 | private: 10 | using _ctor_type = std::function; 11 | _ctor_type _ctor; 12 | 13 | public: 14 | Ctor(lua_State *l, 15 | const std::string &metatable_name) 16 | : _ctor([metatable_name](lua_State *state, Args... args) { 17 | void *addr = lua_newuserdata(state, sizeof(T)); 18 | new(addr) T(args...); 19 | luaL_setmetatable(state, metatable_name.c_str()); 20 | }) { 21 | lua_pushlightuserdata(l, (void *)static_cast(this)); 22 | lua_pushcclosure(l, &detail::_lua_dispatcher, 1); 23 | lua_setfield(l, -2, "new"); 24 | } 25 | 26 | int Apply(lua_State *l) { 27 | std::tuple args = detail::_get_args(l); 28 | auto pack = std::tuple_cat(std::make_tuple(l), args); 29 | detail::_lift(_ctor, pack); 30 | // The constructor will leave a single userdata entry on the stack 31 | return 1; 32 | } 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /third_party/Selene/include/selene/Dtor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "BaseFun.h" 4 | 5 | namespace sel { 6 | 7 | template 8 | class Dtor : public BaseFun { 9 | private: 10 | std::string _metatable_name; 11 | public: 12 | Dtor(lua_State *l, 13 | const std::string &metatable_name) 14 | : _metatable_name(metatable_name) { 15 | lua_pushlightuserdata(l, (void *)(this)); 16 | lua_pushcclosure(l, &detail::_lua_dispatcher, 1); 17 | lua_setfield(l, -2, "__gc"); 18 | } 19 | 20 | int Apply(lua_State *l) { 21 | T *t = (T *)luaL_checkudata(l, 1, _metatable_name.c_str()); 22 | t->~T(); 23 | return 0; 24 | } 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /third_party/Selene/include/selene/ExceptionTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace sel { 8 | 9 | class SeleneException : public std::exception {}; 10 | 11 | class TypeError : public SeleneException { 12 | std::string _message; 13 | public: 14 | explicit TypeError(std::string expected) 15 | : _message(std::move(expected) 16 | + " expected, got no object.") {} 17 | explicit TypeError(std::string expected, std::string const & actual) 18 | : _message(std::move(expected) 19 | + " expected, got " + actual + '.') {} 20 | char const * what() const noexcept override { 21 | return _message.c_str(); 22 | } 23 | }; 24 | 25 | class CopyUnregisteredType : public SeleneException { 26 | public: 27 | using TypeID = std::reference_wrapper; 28 | explicit CopyUnregisteredType(TypeID type) : _type(type) {} 29 | 30 | TypeID getType() const 31 | { 32 | return _type; 33 | } 34 | char const * what() const noexcept override { 35 | return "Tried to copy an object of an unregistered type. " 36 | "Please register classes before passing instances by value."; 37 | } 38 | private: 39 | TypeID _type; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /third_party/Selene/include/selene/LuaName.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | extern "C" { 6 | #include 7 | } 8 | 9 | namespace sel { 10 | /* 11 | * Used to ensure that globals set in Lua are deleted (set to nil) in 12 | * the event that the parent object is destroyed. Checks if the Lua 13 | * context in which it was registered still exists before doing so. 14 | * Prevents copying but permits moving. 15 | */ 16 | class LuaName { 17 | private: 18 | lua_State **_l; 19 | std::string _name; 20 | 21 | public: 22 | LuaName(lua_State *&l, const std::string &name) : _l(&l), _name(name) {} 23 | LuaName(const LuaName &other) = delete; 24 | LuaName(LuaName &&other) 25 | : _l(other._l), 26 | _name(other._name) { 27 | *other._l = nullptr; 28 | } 29 | ~LuaName() { 30 | if (_l != nullptr && *_l != nullptr) { 31 | lua_pushnil(*_l); 32 | lua_setglobal(*_l, _name.c_str()); 33 | } 34 | } 35 | 36 | void Register() { 37 | if (_l != nullptr && *_l != nullptr) { 38 | lua_setglobal(*_l, _name.c_str()); 39 | } 40 | } 41 | 42 | std::string GetName() const {return _name;} 43 | lua_State *GetState() {return *_l;} 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /third_party/Selene/include/selene/Tuple.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Selector.h" 5 | 6 | namespace sel { 7 | template 8 | class Tuple { 9 | private: 10 | std::tuple _tuple; 11 | public: 12 | Tuple(T&... args) : _tuple(args...) {} 13 | 14 | void operator=(const sel::Selector &s) { 15 | _tuple = s.GetTuple::type...>(); 16 | } 17 | }; 18 | 19 | template 20 | Tuple tie(T&... args) { 21 | return Tuple(args...); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /third_party/Selene/include/selene/traits.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /* 5 | * Implements various type trait objects 6 | */ 7 | 8 | namespace sel { 9 | namespace detail { 10 | 11 | template 12 | struct _arity { 13 | static constexpr int value = 1; 14 | }; 15 | 16 | template 17 | struct _arity> { 18 | static constexpr int value = sizeof...(Vs); 19 | }; 20 | 21 | template <> 22 | struct _arity { 23 | static constexpr int value = 0; 24 | }; 25 | 26 | template 27 | struct _indices {}; 28 | 29 | template 30 | struct _indices_builder : _indices_builder {}; 31 | 32 | template 33 | struct _indices_builder<0, Is...> { 34 | using type = _indices; 35 | }; 36 | 37 | template struct _id {}; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /third_party/Selene/selene.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // TODO: remove this? 4 | #if defined(_MSC_VER) && _MSC_VER < 1900 // before MSVS-14 CTP1 5 | #define constexpr const 6 | #endif 7 | 8 | #include "include/selene/State.h" 9 | #include "include/selene/Tuple.h" 10 | -------------------------------------------------------------------------------- /third_party/Selene/test/common/lifetime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace test_lifetime { 4 | 5 | struct InstanceCounter { 6 | static int instances; 7 | InstanceCounter() { ++instances; } 8 | InstanceCounter(const InstanceCounter &) { ++instances; } 9 | InstanceCounter & operator=(const InstanceCounter &) { ++instances; return *this;} 10 | ~InstanceCounter() { --instances; } 11 | }; 12 | int InstanceCounter::instances = 0; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /third_party/Selene/test/metatable_tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct Qux { 6 | int baz() { return 4; } 7 | int qux = 3; 8 | }; 9 | 10 | static Qux qux; 11 | 12 | Qux *GetQuxPtr() { return &qux; } 13 | Qux &GetQuxRef() { return qux; } 14 | 15 | bool test_metatable_registry_ptr(sel::State &state) { 16 | state["get_instance"] = &GetQuxPtr; 17 | state["Qux"].SetClass("baz", &Qux::baz); 18 | state.Load("../test/test_metatable.lua"); 19 | return state["call_method"]() == 4; 20 | } 21 | 22 | bool test_metatable_registry_ref(sel::State &state) { 23 | state["get_instance"] = &GetQuxRef; 24 | state["Qux"].SetClass("baz", &Qux::baz); 25 | state.Load("../test/test_metatable.lua"); 26 | return state["call_method"]() == 4; 27 | } 28 | 29 | bool test_metatable_ptr_member(sel::State &state) { 30 | state["get_instance"] = &GetQuxPtr; 31 | state["Qux"].SetClass("baz", &Qux::baz, "qux", &Qux::qux); 32 | state.Load("../test/test_metatable.lua"); 33 | return state["access_member"]() == 3; 34 | } 35 | 36 | bool test_metatable_ref_member(sel::State &state) { 37 | state["get_instance"] = &GetQuxRef; 38 | state["Qux"].SetClass("baz", &Qux::baz, "qux", &Qux::qux); 39 | state.Load("../test/test_metatable.lua"); 40 | return state["access_member"]() == 3; 41 | } 42 | -------------------------------------------------------------------------------- /third_party/Selene/test/test.lua: -------------------------------------------------------------------------------- 1 | function foo() 2 | end 3 | 4 | function add(a, b) 5 | return a + b 6 | end 7 | 8 | function sum_and_difference(a, b) 9 | return (a+b), (a-b) 10 | end 11 | 12 | function bar() 13 | return 4, true, "hi" 14 | end 15 | 16 | function execute() 17 | return cadd(5, 6); 18 | end 19 | 20 | function doozy(a) 21 | x, y = doozy_c(a, 2 * a) 22 | return x * y 23 | end 24 | 25 | mytable = {} 26 | function mytable.foo() 27 | return 4 28 | end 29 | 30 | function embedded_nulls() 31 | return "\0h\0i" 32 | end 33 | 34 | my_global = 4 35 | 36 | my_table = {} 37 | my_table[3] = "hi" 38 | my_table["key"] = 6.4 39 | 40 | nested_table = {} 41 | nested_table[2] = -3; 42 | nested_table["foo"] = "bar"; 43 | 44 | my_table["nested"] = nested_table 45 | 46 | global1 = 5 47 | global2 = 5 48 | 49 | function resumable() 50 | coroutine.yield(1) 51 | coroutine.yield(2) 52 | return 3 53 | end 54 | 55 | co = coroutine.create(resumable) 56 | 57 | function resume_co() 58 | ran, value = coroutine.resume(co) 59 | return value 60 | end 61 | 62 | function set_global() 63 | global1 = 8 64 | end 65 | 66 | should_be_one = 0 67 | 68 | function should_run_once() 69 | should_be_one = should_be_one + 1 70 | end -------------------------------------------------------------------------------- /third_party/Selene/test/test_class.lua: -------------------------------------------------------------------------------- 1 | bar = Bar.new(8) 2 | barx = bar:get_x() 3 | barp = bar:print(2) 4 | -------------------------------------------------------------------------------- /third_party/Selene/test/test_error.lua: -------------------------------------------------------------------------------- 1 | function err_func1(x, y) 2 | err_func2(x + y) 3 | end 4 | 5 | function divide_by_zero() 6 | return 1 / 0 7 | end 8 | 9 | function _overflow(n) 10 | return _overflow(n + 1) + 1 11 | end 12 | 13 | function do_overflow() 14 | _overflow(1) 15 | end 16 | -------------------------------------------------------------------------------- /third_party/Selene/test/test_exceptions.lua: -------------------------------------------------------------------------------- 1 | function call_protected(function_name) 2 | ok, msg = pcall(_ENV[function_name]) 3 | return ok, tostring(msg) 4 | end 5 | 6 | function raise(exception_message) 7 | error(exception_message) 8 | end 9 | -------------------------------------------------------------------------------- /third_party/Selene/test/test_gc.lua: -------------------------------------------------------------------------------- 1 | objs = {} 2 | function make_ten() 3 | for i = 1, 10 do 4 | objs[i] = GCTest.new() 5 | end 6 | end 7 | 8 | function destroy_ten() 9 | for i = 1, 10 do 10 | objs[i] = nil 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /third_party/Selene/test/test_metatable.lua: -------------------------------------------------------------------------------- 1 | function call_method() 2 | instance = get_instance() 3 | return instance:baz() 4 | end 5 | 6 | function access_member() 7 | instance = get_instance() 8 | return instance:qux() 9 | end -------------------------------------------------------------------------------- /third_party/Selene/test/test_ref.lua: -------------------------------------------------------------------------------- 1 | function add(a, b) 2 | return a+b 3 | end 4 | 5 | function subtract(a, b) 6 | return a-b 7 | end 8 | 9 | function pass_add(x, y) 10 | return take_fun_arg(add, x, y) 11 | end 12 | 13 | function pass_sub(x, y) 14 | return take_fun_arg(subtract, x, y) 15 | end 16 | 17 | a = 4 18 | 19 | function mutate_a(new_a) 20 | a = new_a 21 | end 22 | 23 | test = "" 24 | 25 | function foo() 26 | test = "foo" 27 | end 28 | 29 | function bar() 30 | test = "bar" 31 | end 32 | 33 | function return_two() 34 | return 1, 2 35 | end 36 | -------------------------------------------------------------------------------- /third_party/Selene/test/test_syntax_error.lua: -------------------------------------------------------------------------------- 1 | function syntax_error() 2 | 1 2 3 4 3 | end 4 | -------------------------------------------------------------------------------- /third_party/asio/LICENSE-asio: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /third_party/asio/asio/basic_streambuf_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // basic_streambuf_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BASIC_STREAMBUF_FWD_HPP 12 | #define ASIO_BASIC_STREAMBUF_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_NO_IOSTREAM) 21 | 22 | #include 23 | 24 | namespace asio { 25 | 26 | template > 27 | class basic_streambuf; 28 | 29 | } // namespace asio 30 | 31 | #endif // !defined(ASIO_NO_IOSTREAM) 32 | 33 | #endif // ASIO_BASIC_STREAMBUF_FWD_HPP 34 | -------------------------------------------------------------------------------- /third_party/asio/asio/buffered_read_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_read_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_READ_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_READ_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_read_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_READ_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /third_party/asio/asio/buffered_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /third_party/asio/asio/buffered_write_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_write_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_write_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /third_party/asio/asio/deadline_timer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // deadline_timer.hpp 3 | // ~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DEADLINE_TIMER_HPP 12 | #define ASIO_DEADLINE_TIMER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_BOOST_DATE_TIME) \ 21 | || defined(GENERATING_DOCUMENTATION) 22 | 23 | #include "asio/detail/socket_types.hpp" // Must come before posix_time. 24 | #include "asio/basic_deadline_timer.hpp" 25 | 26 | #include 27 | 28 | namespace asio { 29 | 30 | /// Typedef for the typical usage of timer. Uses a UTC clock. 31 | typedef basic_deadline_timer deadline_timer; 32 | 33 | } // namespace asio 34 | 35 | #endif // defined(ASIO_HAS_BOOST_DATE_TIME) 36 | // || defined(GENERATING_DOCUMENTATION) 37 | 38 | #endif // ASIO_DEADLINE_TIMER_HPP 39 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/addressof.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/addressof.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_ADDRESSOF_HPP 12 | #define ASIO_DETAIL_ADDRESSOF_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_STD_ADDRESSOF) 21 | # include 22 | #else // defined(ASIO_HAS_STD_ADDRESSOF) 23 | # include 24 | #endif // defined(ASIO_HAS_STD_ADDRESSOF) 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_STD_ADDRESSOF) 30 | using std::addressof; 31 | #else // defined(ASIO_HAS_STD_ADDRESSOF) 32 | using boost::addressof; 33 | #endif // defined(ASIO_HAS_STD_ADDRESSOF) 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_ADDRESSOF_HPP 39 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/array.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/array.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_ARRAY_HPP 12 | #define ASIO_DETAIL_ARRAY_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_STD_ARRAY) 21 | # include 22 | #else // defined(ASIO_HAS_STD_ARRAY) 23 | # include 24 | #endif // defined(ASIO_HAS_STD_ARRAY) 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_STD_ARRAY) 30 | using std::array; 31 | #else // defined(ASIO_HAS_STD_ARRAY) 32 | using boost::array; 33 | #endif // defined(ASIO_HAS_STD_ARRAY) 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_ARRAY_HPP 39 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/array_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/array_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_ARRAY_FWD_HPP 12 | #define ASIO_DETAIL_ARRAY_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace boost { 21 | 22 | template 23 | class array; 24 | 25 | } // namespace boost 26 | 27 | // Standard library components can't be forward declared, so we'll have to 28 | // include the array header. Fortunately, it's fairly lightweight and doesn't 29 | // add significantly to the compile time. 30 | #if defined(ASIO_HAS_STD_ARRAY) 31 | # include 32 | #endif // defined(ASIO_HAS_STD_ARRAY) 33 | 34 | #endif // ASIO_DETAIL_ARRAY_FWD_HPP 35 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/assert.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/assert.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_ASSERT_HPP 12 | #define ASIO_DETAIL_ASSERT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_BOOST_ASSERT) 21 | # include 22 | #else // defined(ASIO_HAS_BOOST_ASSERT) 23 | # include 24 | #endif // defined(ASIO_HAS_BOOST_ASSERT) 25 | 26 | #if defined(ASIO_HAS_BOOST_ASSERT) 27 | # define ASIO_ASSERT(expr) BOOST_ASSERT(expr) 28 | #else // defined(ASIO_HAS_BOOST_ASSERT) 29 | # define ASIO_ASSERT(expr) assert(expr) 30 | #endif // defined(ASIO_HAS_BOOST_ASSERT) 31 | 32 | #endif // ASIO_DETAIL_ASSERT_HPP 33 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/cstdint.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/cstdint.hpp 3 | // ~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_CSTDINT_HPP 12 | #define ASIO_DETAIL_CSTDINT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_CSTDINT) 21 | # include 22 | #else // defined(ASIO_HAS_CSTDINT) 23 | # include 24 | #endif // defined(ASIO_HAS_CSTDINT) 25 | 26 | namespace asio { 27 | 28 | #if defined(ASIO_HAS_CSTDINT) 29 | using std::int16_t; 30 | using std::uint16_t; 31 | using std::int32_t; 32 | using std::uint32_t; 33 | using std::int64_t; 34 | using std::uint64_t; 35 | #else // defined(ASIO_HAS_CSTDINT) 36 | using boost::int16_t; 37 | using boost::uint16_t; 38 | using boost::int32_t; 39 | using boost::uint32_t; 40 | using boost::int64_t; 41 | using boost::uint64_t; 42 | #endif // defined(ASIO_HAS_CSTDINT) 43 | 44 | } // namespace asio 45 | 46 | #endif // ASIO_DETAIL_CSTDINT_HPP 47 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/date_time_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/date_time_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_DATE_TIME_FWD_HPP 12 | #define ASIO_DETAIL_DATE_TIME_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace boost { 21 | namespace date_time { 22 | 23 | template 24 | class base_time; 25 | 26 | } // namespace date_time 27 | namespace posix_time { 28 | 29 | class ptime; 30 | 31 | } // namespace posix_time 32 | } // namespace boost 33 | 34 | #endif // ASIO_DETAIL_DATE_TIME_FWD_HPP 35 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/dependent_type.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/dependent_type.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_DEPENDENT_TYPE_HPP 12 | #define ASIO_DETAIL_DEPENDENT_TYPE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace detail { 24 | 25 | template 26 | struct dependent_type 27 | { 28 | typedef T type; 29 | }; 30 | 31 | } // namespace detail 32 | } // namespace asio 33 | 34 | #include "asio/detail/pop_options.hpp" 35 | 36 | #endif // ASIO_DETAIL_DEPENDENT_TYPE_HPP 37 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/event.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/event.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_EVENT_HPP 12 | #define ASIO_DETAIL_EVENT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | # include "asio/detail/null_event.hpp" 22 | #elif defined(ASIO_WINDOWS) 23 | # include "asio/detail/win_event.hpp" 24 | #elif defined(ASIO_HAS_PTHREADS) 25 | # include "asio/detail/posix_event.hpp" 26 | #elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 27 | # include "asio/detail/std_event.hpp" 28 | #else 29 | # error Only Windows, POSIX and std::condition_variable are supported! 30 | #endif 31 | 32 | namespace asio { 33 | namespace detail { 34 | 35 | #if !defined(ASIO_HAS_THREADS) 36 | typedef null_event event; 37 | #elif defined(ASIO_WINDOWS) 38 | typedef win_event event; 39 | #elif defined(ASIO_HAS_PTHREADS) 40 | typedef posix_event event; 41 | #elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 42 | typedef std_event event; 43 | #endif 44 | 45 | } // namespace detail 46 | } // namespace asio 47 | 48 | #endif // ASIO_DETAIL_EVENT_HPP 49 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/fd_set_adapter.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/fd_set_adapter.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_FD_SET_ADAPTER_HPP 12 | #define ASIO_DETAIL_FD_SET_ADAPTER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_WINDOWS_RUNTIME) 21 | 22 | #include "asio/detail/posix_fd_set_adapter.hpp" 23 | #include "asio/detail/win_fd_set_adapter.hpp" 24 | 25 | namespace asio { 26 | namespace detail { 27 | 28 | #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 29 | typedef win_fd_set_adapter fd_set_adapter; 30 | #else 31 | typedef posix_fd_set_adapter fd_set_adapter; 32 | #endif 33 | 34 | } // namespace detail 35 | } // namespace asio 36 | 37 | #endif // !defined(ASIO_WINDOWS_RUNTIME) 38 | 39 | #endif // ASIO_DETAIL_FD_SET_ADAPTER_HPP 40 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/function.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/function.hpp 3 | // ~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_FUNCTION_HPP 12 | #define ASIO_DETAIL_FUNCTION_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_STD_FUNCTION) 21 | # include 22 | #else // defined(ASIO_HAS_STD_FUNCTION) 23 | # include 24 | #endif // defined(ASIO_HAS_STD_FUNCTION) 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_STD_FUNCTION) 30 | using std::function; 31 | #else // defined(ASIO_HAS_STD_FUNCTION) 32 | using boost::function; 33 | #endif // defined(ASIO_HAS_STD_FUNCTION) 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_FUNCTION_HPP 39 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/impl/posix_event.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/impl/posix_event.ipp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_IMPL_POSIX_EVENT_IPP 12 | #define ASIO_DETAIL_IMPL_POSIX_EVENT_IPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_PTHREADS) 21 | 22 | #include "asio/detail/posix_event.hpp" 23 | #include "asio/detail/throw_error.hpp" 24 | #include "asio/error.hpp" 25 | 26 | #include "asio/detail/push_options.hpp" 27 | 28 | namespace asio { 29 | namespace detail { 30 | 31 | posix_event::posix_event() 32 | : state_(0) 33 | { 34 | int error = ::pthread_cond_init(&cond_, 0); 35 | asio::error_code ec(error, 36 | asio::error::get_system_category()); 37 | asio::detail::throw_error(ec, "event"); 38 | } 39 | 40 | } // namespace detail 41 | } // namespace asio 42 | 43 | #include "asio/detail/pop_options.hpp" 44 | 45 | #endif // defined(ASIO_HAS_PTHREADS) 46 | 47 | #endif // ASIO_DETAIL_IMPL_POSIX_EVENT_IPP 48 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/impl/posix_mutex.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/impl/posix_mutex.ipp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP 12 | #define ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_PTHREADS) 21 | 22 | #include "asio/detail/posix_mutex.hpp" 23 | #include "asio/detail/throw_error.hpp" 24 | #include "asio/error.hpp" 25 | 26 | #include "asio/detail/push_options.hpp" 27 | 28 | namespace asio { 29 | namespace detail { 30 | 31 | posix_mutex::posix_mutex() 32 | { 33 | int error = ::pthread_mutex_init(&mutex_, 0); 34 | asio::error_code ec(error, 35 | asio::error::get_system_category()); 36 | asio::detail::throw_error(ec, "mutex"); 37 | } 38 | 39 | } // namespace detail 40 | } // namespace asio 41 | 42 | #include "asio/detail/pop_options.hpp" 43 | 44 | #endif // defined(ASIO_HAS_PTHREADS) 45 | 46 | #endif // ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP 47 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/impl/posix_tss_ptr.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/impl/posix_tss_ptr.ipp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP 12 | #define ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_PTHREADS) 21 | 22 | #include "asio/detail/posix_tss_ptr.hpp" 23 | #include "asio/detail/throw_error.hpp" 24 | #include "asio/error.hpp" 25 | 26 | #include "asio/detail/push_options.hpp" 27 | 28 | namespace asio { 29 | namespace detail { 30 | 31 | void posix_tss_ptr_create(pthread_key_t& key) 32 | { 33 | int error = ::pthread_key_create(&key, 0); 34 | asio::error_code ec(error, 35 | asio::error::get_system_category()); 36 | asio::detail::throw_error(ec, "tss"); 37 | } 38 | 39 | } // namespace detail 40 | } // namespace asio 41 | 42 | #include "asio/detail/pop_options.hpp" 43 | 44 | #endif // defined(ASIO_HAS_PTHREADS) 45 | 46 | #endif // ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP 47 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/limits.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/limits.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_LIMITS_HPP 12 | #define ASIO_DETAIL_LIMITS_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_BOOST_LIMITS) 21 | # include 22 | #else // defined(ASIO_HAS_BOOST_LIMITS) 23 | # include 24 | #endif // defined(ASIO_HAS_BOOST_LIMITS) 25 | 26 | #endif // ASIO_DETAIL_LIMITS_HPP 27 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/mutex.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/mutex.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_MUTEX_HPP 12 | #define ASIO_DETAIL_MUTEX_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | # include "asio/detail/null_mutex.hpp" 22 | #elif defined(ASIO_WINDOWS) 23 | # include "asio/detail/win_mutex.hpp" 24 | #elif defined(ASIO_HAS_PTHREADS) 25 | # include "asio/detail/posix_mutex.hpp" 26 | #elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 27 | # include "asio/detail/std_mutex.hpp" 28 | #else 29 | # error Only Windows, POSIX and std::mutex are supported! 30 | #endif 31 | 32 | namespace asio { 33 | namespace detail { 34 | 35 | #if !defined(ASIO_HAS_THREADS) 36 | typedef null_mutex mutex; 37 | #elif defined(ASIO_WINDOWS) 38 | typedef win_mutex mutex; 39 | #elif defined(ASIO_HAS_PTHREADS) 40 | typedef posix_mutex mutex; 41 | #elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 42 | typedef std_mutex mutex; 43 | #endif 44 | 45 | } // namespace detail 46 | } // namespace asio 47 | 48 | #endif // ASIO_DETAIL_MUTEX_HPP 49 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/noncopyable.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/noncopyable.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NONCOPYABLE_HPP 12 | #define ASIO_DETAIL_NONCOPYABLE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace detail { 24 | 25 | class noncopyable 26 | { 27 | protected: 28 | noncopyable() {} 29 | ~noncopyable() {} 30 | private: 31 | noncopyable(const noncopyable&); 32 | const noncopyable& operator=(const noncopyable&); 33 | }; 34 | 35 | } // namespace detail 36 | 37 | using asio::detail::noncopyable; 38 | 39 | } // namespace asio 40 | 41 | #include "asio/detail/pop_options.hpp" 42 | 43 | #endif // ASIO_DETAIL_NONCOPYABLE_HPP 44 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/null_fenced_block.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/null_fenced_block.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NULL_FENCED_BLOCK_HPP 12 | #define ASIO_DETAIL_NULL_FENCED_BLOCK_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/push_options.hpp" 19 | 20 | namespace asio { 21 | namespace detail { 22 | 23 | class null_fenced_block 24 | : private noncopyable 25 | { 26 | public: 27 | enum half_or_full_t { half, full }; 28 | 29 | // Constructor. 30 | explicit null_fenced_block(half_or_full_t) 31 | { 32 | } 33 | 34 | // Destructor. 35 | ~null_fenced_block() 36 | { 37 | } 38 | }; 39 | 40 | } // namespace detail 41 | } // namespace asio 42 | 43 | #include "asio/detail/pop_options.hpp" 44 | 45 | #endif // ASIO_DETAIL_NULL_FENCED_BLOCK_HPP 46 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/null_static_mutex.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/null_static_mutex.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NULL_STATIC_MUTEX_HPP 12 | #define ASIO_DETAIL_NULL_STATIC_MUTEX_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | 22 | #include "asio/detail/scoped_lock.hpp" 23 | 24 | #include "asio/detail/push_options.hpp" 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | struct null_static_mutex 30 | { 31 | typedef asio::detail::scoped_lock scoped_lock; 32 | 33 | // Initialise the mutex. 34 | void init() 35 | { 36 | } 37 | 38 | // Lock the mutex. 39 | void lock() 40 | { 41 | } 42 | 43 | // Unlock the mutex. 44 | void unlock() 45 | { 46 | } 47 | 48 | int unused_; 49 | }; 50 | 51 | #define ASIO_NULL_STATIC_MUTEX_INIT { 0 } 52 | 53 | } // namespace detail 54 | } // namespace asio 55 | 56 | #include "asio/detail/pop_options.hpp" 57 | 58 | #endif // !defined(ASIO_HAS_THREADS) 59 | 60 | #endif // ASIO_DETAIL_NULL_STATIC_MUTEX_HPP 61 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/operation.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/operation.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_OPERATION_HPP 12 | #define ASIO_DETAIL_OPERATION_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_IOCP) 21 | # include "asio/detail/win_iocp_operation.hpp" 22 | #else 23 | # include "asio/detail/task_io_service_operation.hpp" 24 | #endif 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_IOCP) 30 | typedef win_iocp_operation operation; 31 | #else 32 | typedef task_io_service_operation operation; 33 | #endif 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_OPERATION_HPP 39 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/reactor.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/reactor.hpp 3 | // ~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_REACTOR_HPP 12 | #define ASIO_DETAIL_REACTOR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/reactor_fwd.hpp" 19 | 20 | #if defined(ASIO_HAS_EPOLL) 21 | # include "asio/detail/epoll_reactor.hpp" 22 | #elif defined(ASIO_HAS_KQUEUE) 23 | # include "asio/detail/kqueue_reactor.hpp" 24 | #elif defined(ASIO_HAS_DEV_POLL) 25 | # include "asio/detail/dev_poll_reactor.hpp" 26 | #elif defined(ASIO_WINDOWS_RUNTIME) 27 | # include "asio/detail/null_reactor.hpp" 28 | #else 29 | # include "asio/detail/select_reactor.hpp" 30 | #endif 31 | 32 | #endif // ASIO_DETAIL_REACTOR_HPP 33 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/reactor_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/reactor_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_REACTOR_FWD_HPP 12 | #define ASIO_DETAIL_REACTOR_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace asio { 21 | namespace detail { 22 | 23 | #if defined(ASIO_WINDOWS_RUNTIME) 24 | typedef class null_reactor reactor; 25 | #elif defined(ASIO_HAS_IOCP) 26 | typedef class select_reactor reactor; 27 | #elif defined(ASIO_HAS_EPOLL) 28 | typedef class epoll_reactor reactor; 29 | #elif defined(ASIO_HAS_KQUEUE) 30 | typedef class kqueue_reactor reactor; 31 | #elif defined(ASIO_HAS_DEV_POLL) 32 | typedef class dev_poll_reactor reactor; 33 | #else 34 | typedef class select_reactor reactor; 35 | #endif 36 | 37 | } // namespace detail 38 | } // namespace asio 39 | 40 | #endif // ASIO_DETAIL_REACTOR_FWD_HPP 41 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/regex_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/regex_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_REGEX_FWD_HPP 12 | #define ASIO_DETAIL_REGEX_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #if defined(ASIO_HAS_BOOST_REGEX) 19 | 20 | #include 21 | #include 22 | 23 | namespace boost { 24 | 25 | template 26 | struct sub_match; 27 | 28 | template 29 | class match_results; 30 | 31 | } // namespace boost 32 | 33 | #endif // defined(ASIO_HAS_BOOST_REGEX) 34 | 35 | #endif // ASIO_DETAIL_REGEX_FWD_HPP 36 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/shared_ptr.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/shared_ptr.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_SHARED_PTR_HPP 12 | #define ASIO_DETAIL_SHARED_PTR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_STD_SHARED_PTR) 21 | # include 22 | #else // defined(ASIO_HAS_STD_SHARED_PTR) 23 | # include 24 | #endif // defined(ASIO_HAS_STD_SHARED_PTR) 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_STD_SHARED_PTR) 30 | using std::shared_ptr; 31 | #else // defined(ASIO_HAS_STD_SHARED_PTR) 32 | using boost::shared_ptr; 33 | #endif // defined(ASIO_HAS_STD_SHARED_PTR) 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_SHARED_PTR_HPP 39 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/signal_init.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/signal_init.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_SIGNAL_INIT_HPP 12 | #define ASIO_DETAIL_SIGNAL_INIT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) 21 | 22 | #include 23 | 24 | #include "asio/detail/push_options.hpp" 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | template 30 | class signal_init 31 | { 32 | public: 33 | // Constructor. 34 | signal_init() 35 | { 36 | std::signal(Signal, SIG_IGN); 37 | } 38 | }; 39 | 40 | } // namespace detail 41 | } // namespace asio 42 | 43 | #include "asio/detail/pop_options.hpp" 44 | 45 | #endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) 46 | 47 | #endif // ASIO_DETAIL_SIGNAL_INIT_HPP 48 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/signal_op.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/signal_op.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_SIGNAL_OP_HPP 12 | #define ASIO_DETAIL_SIGNAL_OP_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/operation.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace detail { 25 | 26 | class signal_op 27 | : public operation 28 | { 29 | public: 30 | // The error code to be passed to the completion handler. 31 | asio::error_code ec_; 32 | 33 | // The signal number to be passed to the completion handler. 34 | int signal_number_; 35 | 36 | protected: 37 | signal_op(func_type func) 38 | : operation(func), 39 | signal_number_(0) 40 | { 41 | } 42 | }; 43 | 44 | } // namespace detail 45 | } // namespace asio 46 | 47 | #include "asio/detail/pop_options.hpp" 48 | 49 | #endif // ASIO_DETAIL_SIGNAL_OP_HPP 50 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/task_io_service_thread_info.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/task_io_service_thread_info.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_TASK_IO_SERVICE_THREAD_INFO_HPP 12 | #define ASIO_DETAIL_TASK_IO_SERVICE_THREAD_INFO_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/op_queue.hpp" 19 | #include "asio/detail/thread_info_base.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace detail { 25 | 26 | class task_io_service; 27 | class task_io_service_operation; 28 | 29 | struct task_io_service_thread_info : public thread_info_base 30 | { 31 | op_queue private_op_queue; 32 | long private_outstanding_work; 33 | }; 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #include "asio/detail/pop_options.hpp" 39 | 40 | #endif // ASIO_DETAIL_TASK_IO_SERVICE_THREAD_INFO_HPP 41 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/timer_scheduler.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/timer_scheduler.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_TIMER_SCHEDULER_HPP 12 | #define ASIO_DETAIL_TIMER_SCHEDULER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/timer_scheduler_fwd.hpp" 20 | 21 | #if defined(ASIO_WINDOWS_RUNTIME) 22 | # include "asio/detail/winrt_timer_scheduler.hpp" 23 | #elif defined(ASIO_HAS_IOCP) 24 | # include "asio/detail/win_iocp_io_service.hpp" 25 | #elif defined(ASIO_HAS_EPOLL) 26 | # include "asio/detail/epoll_reactor.hpp" 27 | #elif defined(ASIO_HAS_KQUEUE) 28 | # include "asio/detail/kqueue_reactor.hpp" 29 | #elif defined(ASIO_HAS_DEV_POLL) 30 | # include "asio/detail/dev_poll_reactor.hpp" 31 | #else 32 | # include "asio/detail/select_reactor.hpp" 33 | #endif 34 | 35 | #endif // ASIO_DETAIL_TIMER_SCHEDULER_HPP 36 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/timer_scheduler_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/timer_scheduler_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP 12 | #define ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace asio { 21 | namespace detail { 22 | 23 | #if defined(ASIO_WINDOWS_RUNTIME) 24 | typedef class winrt_timer_scheduler timer_scheduler; 25 | #elif defined(ASIO_HAS_IOCP) 26 | typedef class win_iocp_io_service timer_scheduler; 27 | #elif defined(ASIO_HAS_EPOLL) 28 | typedef class epoll_reactor timer_scheduler; 29 | #elif defined(ASIO_HAS_KQUEUE) 30 | typedef class kqueue_reactor timer_scheduler; 31 | #elif defined(ASIO_HAS_DEV_POLL) 32 | typedef class dev_poll_reactor timer_scheduler; 33 | #else 34 | typedef class select_reactor timer_scheduler; 35 | #endif 36 | 37 | } // namespace detail 38 | } // namespace asio 39 | 40 | #endif // ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP 41 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/wait_op.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/wait_op.hpp 3 | // ~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_WAIT_OP_HPP 12 | #define ASIO_DETAIL_WAIT_OP_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/operation.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace detail { 25 | 26 | class wait_op 27 | : public operation 28 | { 29 | public: 30 | // The error code to be passed to the completion handler. 31 | asio::error_code ec_; 32 | 33 | protected: 34 | wait_op(func_type func) 35 | : operation(func) 36 | { 37 | } 38 | }; 39 | 40 | } // namespace detail 41 | } // namespace asio 42 | 43 | #include "asio/detail/pop_options.hpp" 44 | 45 | #endif // ASIO_DETAIL_WAIT_OP_HPP 46 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/weak_ptr.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/weak_ptr.hpp 3 | // ~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_WEAK_PTR_HPP 12 | #define ASIO_DETAIL_WEAK_PTR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_STD_SHARED_PTR) 21 | # include 22 | #else // defined(ASIO_HAS_STD_SHARED_PTR) 23 | # include 24 | #endif // defined(ASIO_HAS_STD_SHARED_PTR) 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_STD_SHARED_PTR) 30 | using std::weak_ptr; 31 | #else // defined(ASIO_HAS_STD_SHARED_PTR) 32 | using boost::weak_ptr; 33 | #endif // defined(ASIO_HAS_STD_SHARED_PTR) 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_WEAK_PTR_HPP 39 | -------------------------------------------------------------------------------- /third_party/asio/asio/detail/win_iocp_thread_info.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/win_iocp_thread_info.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP 12 | #define ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/thread_info_base.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace detail { 24 | 25 | struct win_iocp_thread_info : public thread_info_base 26 | { 27 | }; 28 | 29 | } // namespace detail 30 | } // namespace asio 31 | 32 | #include "asio/detail/pop_options.hpp" 33 | 34 | #endif // ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP 35 | -------------------------------------------------------------------------------- /third_party/asio/asio/impl/src.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // impl/src.cpp 3 | // ~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #if defined(_MSC_VER) \ 12 | || defined(__BORLANDC__) \ 13 | || defined(__DMC__) 14 | # pragma message ( \ 15 | "This file is deprecated. " \ 16 | "Please #include instead.") 17 | #elif defined(__GNUC__) \ 18 | || defined(__HP_aCC) \ 19 | || defined(__SUNPRO_CC) \ 20 | || defined(__IBMCPP__) 21 | # warning "This file is deprecated." 22 | # warning "Please #include instead." 23 | #endif 24 | 25 | #include "asio/impl/src.hpp" 26 | -------------------------------------------------------------------------------- /third_party/asio/asio/ip/host_name.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ip/host_name.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IP_HOST_NAME_HPP 12 | #define ASIO_IP_HOST_NAME_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include 20 | #include "asio/error_code.hpp" 21 | 22 | #include "asio/detail/push_options.hpp" 23 | 24 | namespace asio { 25 | namespace ip { 26 | 27 | /// Get the current host name. 28 | ASIO_DECL std::string host_name(); 29 | 30 | /// Get the current host name. 31 | ASIO_DECL std::string host_name(asio::error_code& ec); 32 | 33 | } // namespace ip 34 | } // namespace asio 35 | 36 | #include "asio/detail/pop_options.hpp" 37 | 38 | #if defined(ASIO_HEADER_ONLY) 39 | # include "asio/ip/impl/host_name.ipp" 40 | #endif // defined(ASIO_HEADER_ONLY) 41 | 42 | #endif // ASIO_IP_HOST_NAME_HPP 43 | -------------------------------------------------------------------------------- /third_party/asio/asio/posix/stream_descriptor.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // posix/stream_descriptor.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_POSIX_STREAM_DESCRIPTOR_HPP 12 | #define ASIO_POSIX_STREAM_DESCRIPTOR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ 21 | || defined(GENERATING_DOCUMENTATION) 22 | 23 | #include "asio/posix/basic_stream_descriptor.hpp" 24 | 25 | namespace asio { 26 | namespace posix { 27 | 28 | /// Typedef for the typical usage of a stream-oriented descriptor. 29 | typedef basic_stream_descriptor<> stream_descriptor; 30 | 31 | } // namespace posix 32 | } // namespace asio 33 | 34 | #endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) 35 | // || defined(GENERATING_DOCUMENTATION) 36 | 37 | #endif // ASIO_POSIX_STREAM_DESCRIPTOR_HPP 38 | -------------------------------------------------------------------------------- /third_party/asio/asio/serial_port.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // serial_port.hpp 3 | // ~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) 7 | // 8 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 9 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | 12 | #ifndef ASIO_SERIAL_PORT_HPP 13 | #define ASIO_SERIAL_PORT_HPP 14 | 15 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 | # pragma once 17 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 | 19 | #include "asio/detail/config.hpp" 20 | 21 | #if defined(ASIO_HAS_SERIAL_PORT) \ 22 | || defined(GENERATING_DOCUMENTATION) 23 | 24 | #include "asio/basic_serial_port.hpp" 25 | 26 | namespace asio { 27 | 28 | /// Typedef for the typical usage of a serial port. 29 | typedef basic_serial_port<> serial_port; 30 | 31 | } // namespace asio 32 | 33 | #endif // defined(ASIO_HAS_SERIAL_PORT) 34 | // || defined(GENERATING_DOCUMENTATION) 35 | 36 | #endif // ASIO_SERIAL_PORT_HPP 37 | -------------------------------------------------------------------------------- /third_party/asio/asio/signal_set.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // signal_set.hpp 3 | // ~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SIGNAL_SET_HPP 12 | #define ASIO_SIGNAL_SET_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/basic_signal_set.hpp" 20 | 21 | namespace asio { 22 | 23 | /// Typedef for the typical usage of a signal set. 24 | typedef basic_signal_set<> signal_set; 25 | 26 | } // namespace asio 27 | 28 | #endif // ASIO_SIGNAL_SET_HPP 29 | -------------------------------------------------------------------------------- /third_party/asio/asio/ssl.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ssl.hpp 3 | // ~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SSL_HPP 12 | #define ASIO_SSL_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/ssl/basic_context.hpp" 19 | #include "asio/ssl/context.hpp" 20 | #include "asio/ssl/context_base.hpp" 21 | #include "asio/ssl/context_service.hpp" 22 | #include "asio/ssl/error.hpp" 23 | #include "asio/ssl/rfc2818_verification.hpp" 24 | #include "asio/ssl/stream.hpp" 25 | #include "asio/ssl/stream_base.hpp" 26 | #include "asio/ssl/stream_service.hpp" 27 | #include "asio/ssl/verify_context.hpp" 28 | #include "asio/ssl/verify_mode.hpp" 29 | 30 | #endif // ASIO_SSL_HPP 31 | -------------------------------------------------------------------------------- /third_party/asio/asio/streambuf.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // streambuf.hpp 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_STREAMBUF_HPP 12 | #define ASIO_STREAMBUF_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_NO_IOSTREAM) 21 | 22 | #include "asio/basic_streambuf.hpp" 23 | 24 | namespace asio { 25 | 26 | /// Typedef for the typical usage of basic_streambuf. 27 | typedef basic_streambuf<> streambuf; 28 | 29 | } // namespace asio 30 | 31 | #endif // !defined(ASIO_NO_IOSTREAM) 32 | 33 | #endif // ASIO_STREAMBUF_HPP 34 | -------------------------------------------------------------------------------- /third_party/asio/asio/unyield.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // unyield.hpp 3 | // ~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifdef reenter 12 | # undef reenter 13 | #endif 14 | 15 | #ifdef yield 16 | # undef yield 17 | #endif 18 | 19 | #ifdef fork 20 | # undef fork 21 | #endif 22 | -------------------------------------------------------------------------------- /third_party/asio/asio/version.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // version.hpp 3 | // ~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_VERSION_HPP 12 | #define ASIO_VERSION_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | // ASIO_VERSION % 100 is the sub-minor version 19 | // ASIO_VERSION / 100 % 1000 is the minor version 20 | // ASIO_VERSION / 100000 is the major version 21 | #define ASIO_VERSION 101008 // 1.10.8 22 | 23 | #endif // ASIO_VERSION_HPP 24 | -------------------------------------------------------------------------------- /third_party/asio/asio/wait_traits.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // wait_traits.hpp 3 | // ~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_WAIT_TRAITS_HPP 12 | #define ASIO_WAIT_TRAITS_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/push_options.hpp" 19 | 20 | namespace asio { 21 | 22 | /// Wait traits suitable for use with the basic_waitable_timer class template. 23 | template 24 | struct wait_traits 25 | { 26 | /// Convert a clock duration into a duration used for waiting. 27 | /** 28 | * @returns @c d. 29 | */ 30 | static typename Clock::duration to_wait_duration( 31 | const typename Clock::duration& d) 32 | { 33 | return d; 34 | } 35 | }; 36 | 37 | } // namespace asio 38 | 39 | #include "asio/detail/pop_options.hpp" 40 | 41 | #endif // ASIO_WAIT_TRAITS_HPP 42 | -------------------------------------------------------------------------------- /third_party/asio/asio/windows/object_handle.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // windows/object_handle.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // Copyright (c) 2011 Boris Schaeling (boris@highscore.de) 7 | // 8 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 9 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | 12 | #ifndef ASIO_WINDOWS_OBJECT_HANDLE_HPP 13 | #define ASIO_WINDOWS_OBJECT_HANDLE_HPP 14 | 15 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 | # pragma once 17 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 | 19 | #include "asio/detail/config.hpp" 20 | 21 | #if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) \ 22 | || defined(GENERATING_DOCUMENTATION) 23 | 24 | #include "asio/windows/basic_object_handle.hpp" 25 | 26 | namespace asio { 27 | namespace windows { 28 | 29 | /// Typedef for the typical usage of an object handle. 30 | typedef basic_object_handle<> object_handle; 31 | 32 | } // namespace windows 33 | } // namespace asio 34 | 35 | #endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) 36 | // || defined(GENERATING_DOCUMENTATION) 37 | 38 | #endif // ASIO_WINDOWS_OBJECT_HANDLE_HPP 39 | -------------------------------------------------------------------------------- /third_party/asio/asio/windows/random_access_handle.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // windows/random_access_handle.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_HPP 12 | #define ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) \ 21 | || defined(GENERATING_DOCUMENTATION) 22 | 23 | #include "asio/windows/basic_random_access_handle.hpp" 24 | 25 | namespace asio { 26 | namespace windows { 27 | 28 | /// Typedef for the typical usage of a random-access handle. 29 | typedef basic_random_access_handle<> random_access_handle; 30 | 31 | } // namespace windows 32 | } // namespace asio 33 | 34 | #endif // defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) 35 | // || defined(GENERATING_DOCUMENTATION) 36 | 37 | #endif // ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_HPP 38 | -------------------------------------------------------------------------------- /third_party/asio/asio/windows/stream_handle.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // windows/stream_handle.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_WINDOWS_STREAM_HANDLE_HPP 12 | #define ASIO_WINDOWS_STREAM_HANDLE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) \ 21 | || defined(GENERATING_DOCUMENTATION) 22 | 23 | #include "asio/windows/basic_stream_handle.hpp" 24 | 25 | namespace asio { 26 | namespace windows { 27 | 28 | /// Typedef for the typical usage of a stream-oriented handle. 29 | typedef basic_stream_handle<> stream_handle; 30 | 31 | } // namespace windows 32 | } // namespace asio 33 | 34 | #endif // defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) 35 | // || defined(GENERATING_DOCUMENTATION) 36 | 37 | #endif // ASIO_WINDOWS_STREAM_HANDLE_HPP 38 | -------------------------------------------------------------------------------- /third_party/asio/asio/yield.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // yield.hpp 3 | // ~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #include "coroutine.hpp" 12 | 13 | #ifndef reenter 14 | # define reenter(c) ASIO_CORO_REENTER(c) 15 | #endif 16 | 17 | #ifndef yield 18 | # define yield ASIO_CORO_YIELD 19 | #endif 20 | 21 | #ifndef fork 22 | # define fork ASIO_CORO_FORK 23 | #endif 24 | -------------------------------------------------------------------------------- /tube/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0 FATAL_ERROR) 2 | 3 | set(CMAKE_CXX_STANDARD 14) 4 | set(CMAKE_CXX_FLAGS 5 | "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -Wno-register -fPIC -march=native -Wfatal-errors") 6 | 7 | 8 | find_package(PythonInterp 3.7 REQUIRED) 9 | find_package(PythonLibs 3.7 REQUIRED) 10 | 11 | 12 | # lib for other c++ programs 13 | add_library(_tube src_cpp/data_channel.cc) 14 | target_include_directories(_tube PUBLIC ${TORCH_INCLUDE_DIRS}) 15 | target_include_directories(_tube PUBLIC ${PYTHON_INCLUDE_DIRS}) 16 | target_link_libraries(_tube PUBLIC ${TORCH_LIBRARIES} ${TORCH_PYTHON_LIBRARIES}) 17 | 18 | # tests 19 | add_executable(test_data_channel src_cpp/test/test_data_channel.cc) 20 | target_link_libraries(test_data_channel _tube) 21 | 22 | # pybind lib 23 | pybind11_add_module(tube src_cpp/pybind.cc) 24 | target_link_libraries(tube PUBLIC _tube) 25 | -------------------------------------------------------------------------------- /tube/pytube/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | from .data_channel_manager import DataChannelManager 8 | -------------------------------------------------------------------------------- /tube/pytube/utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | """utils""" 8 | 9 | 10 | def assert_eq(real, expected, msg='assert_eq fails'): 11 | assert real == expected, '%s: %s (real) vs %s (expected)' % (msg, real, expected) 12 | -------------------------------------------------------------------------------- /tube/src_cpp/data_block.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "utils.h" 13 | 14 | namespace tube { 15 | 16 | class DataBlock { 17 | public: 18 | DataBlock(const std::string& name, 19 | const std::vector& sizes, 20 | torch::ScalarType dtype) 21 | : name(std::move(name)) 22 | , data(torch::zeros(sizes, dtype)) { 23 | } 24 | 25 | torch::Tensor& getBuffer() { 26 | return data; 27 | } 28 | 29 | std::vector sizes() { 30 | return data.sizes().vec(); 31 | } 32 | 33 | torch::ScalarType dtype() { 34 | return data.scalar_type(); 35 | } 36 | 37 | const std::string name; 38 | torch::Tensor data; 39 | }; 40 | } 41 | 42 | #include "episodic_trajectory.h" 43 | #include "fixed_len_trajectory.h" 44 | #include "indefinite_trajectory.h" 45 | -------------------------------------------------------------------------------- /tube/src_cpp/env_thread.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 2 | // All rights reserved. 3 | // 4 | // This source code is licensed under the license found in the 5 | // LICENSE file in the root directory of this source tree. 6 | // 7 | #pragma once 8 | 9 | namespace tube { 10 | 11 | class EnvThread { 12 | public: 13 | virtual ~EnvThread() { 14 | } 15 | 16 | virtual void mainLoop() = 0; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /visual/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | public/data 4 | 5 | !package.json 6 | !manifest.json 7 | 8 | # dependencies 9 | /node_modules 10 | /.pnp 11 | .pnp.js 12 | 13 | # testing 14 | /coverage 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | .env.local 22 | .env.development.local 23 | .env.test.local 24 | .env.production.local 25 | 26 | npm-debug.log* 27 | yarn-debug.log* 28 | yarn-error.log* 29 | yarn.lock 30 | -------------------------------------------------------------------------------- /visual/README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | Install Node.js if node version < 8. 4 | On Mac, run 5 | ``` 6 | brew install node 7 | ``` 8 | On Linux, run 9 | ``` 10 | sudo apt install nodejs 11 | sudo apt install npm 12 | ``` 13 | Or get installer from [web](https://nodejs.org/en/download/). 14 | 15 | Install npm packages. Run in project root folder: 16 | ``` 17 | yarn 18 | ``` 19 | 20 | # Run 21 | Generate the json file list: 22 | ``` 23 | python gen_file_list.py 24 | ``` 25 | 26 | Start server, and auto rebuild on change: 27 | ``` 28 | npm start 29 | ``` 30 | This should automatically launch a browser tab for the visualization program. 31 | 32 | In the `select game` text bar, we can use the scroll down menu to select a game for 33 | replay, or type in the name of a particular replay to search. We can also manually type 34 | in the specific tick/entry number in the text bar below to go to a particular tick, in 35 | order to investigate what is happening at that moment. 36 | 37 | # Build 38 | ``` 39 | npm run build 40 | ``` 41 | This will minify and put a standalone version in "build" folder -------------------------------------------------------------------------------- /visual/gen_file_list.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | import argparse 8 | import os 9 | import json 10 | 11 | 12 | def get_all_files(root, file_extension): 13 | files = [] 14 | for folder, _, fs in os.walk(root): 15 | for f in fs: 16 | if f.endswith(file_extension): 17 | files.append(os.path.join(folder, f)) 18 | return files 19 | 20 | 21 | parser = argparse.ArgumentParser() 22 | parser.add_argument('--root', type=str, default='public/data') 23 | args = parser.parse_args() 24 | 25 | # folder = os.path.abspath(args.root) 26 | files = get_all_files(args.root, '.json') 27 | 28 | files = [f.replace('public', '.') for f in files] 29 | 30 | with open('./public/files.json', 'w') as outfile: 31 | json.dump(files, outfile, indent=4) 32 | 33 | print( f'Found {len(files)} files. Saved in "./public/files.json"' ) 34 | -------------------------------------------------------------------------------- /visual/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "minirts", 3 | "version": "0.1.0", 4 | "private": true, 5 | "homepage": ".", 6 | "dependencies": { 7 | "pts": "^0.7.0", 8 | "react": "^16.8.2", 9 | "react-autocomplete": "^1.8.1", 10 | "react-dom": "^16.8.2", 11 | "react-dropdown": "^1.6.4", 12 | "react-pts-canvas": "^0.1.2", 13 | "react-scripts": "2.1.5" 14 | }, 15 | "scripts": { 16 | "start": "react-scripts start", 17 | "build": "react-scripts build", 18 | "test": "react-scripts test", 19 | "eject": "react-scripts eject" 20 | }, 21 | "eslintConfig": { 22 | "extends": "react-app" 23 | }, 24 | "browserslist": [ 25 | ">0.2%", 26 | "not dead", 27 | "not ie <= 11", 28 | "not op_mini all" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /visual/public/assets/blue/barrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/barrack.png -------------------------------------------------------------------------------- /visual/public/assets/blue/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/base.png -------------------------------------------------------------------------------- /visual/public/assets/blue/cannon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/cannon.png -------------------------------------------------------------------------------- /visual/public/assets/blue/cavalry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/cavalry.png -------------------------------------------------------------------------------- /visual/public/assets/blue/defense_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/defense_tower.png -------------------------------------------------------------------------------- /visual/public/assets/blue/engineer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/engineer.png -------------------------------------------------------------------------------- /visual/public/assets/blue/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/factory.png -------------------------------------------------------------------------------- /visual/public/assets/blue/flight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/flight.png -------------------------------------------------------------------------------- /visual/public/assets/blue/hangar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/hangar.png -------------------------------------------------------------------------------- /visual/public/assets/blue/resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/resource.png -------------------------------------------------------------------------------- /visual/public/assets/blue/scifiUnit_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/scifiUnit_05.png -------------------------------------------------------------------------------- /visual/public/assets/blue/scifiUnit_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/scifiUnit_06.png -------------------------------------------------------------------------------- /visual/public/assets/blue/scifiUnit_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/scifiUnit_07.png -------------------------------------------------------------------------------- /visual/public/assets/blue/scifiUnit_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/scifiUnit_09.png -------------------------------------------------------------------------------- /visual/public/assets/blue/scifiUnit_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/scifiUnit_10.png -------------------------------------------------------------------------------- /visual/public/assets/blue/soldier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/soldier.png -------------------------------------------------------------------------------- /visual/public/assets/blue/spaceman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/spaceman.png -------------------------------------------------------------------------------- /visual/public/assets/blue/spearman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/spearman.png -------------------------------------------------------------------------------- /visual/public/assets/blue/tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/tank.png -------------------------------------------------------------------------------- /visual/public/assets/blue/tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/tower.png -------------------------------------------------------------------------------- /visual/public/assets/blue/truck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/truck.png -------------------------------------------------------------------------------- /visual/public/assets/blue/worker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/worker.png -------------------------------------------------------------------------------- /visual/public/assets/blue/workshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/blue/workshop.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/archer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/archer.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/archer_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/archer_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/archery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/archery.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/archery_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/archery_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/aviary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/aviary.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/aviary_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/aviary_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/barrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/barrack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/barrack_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/barrack_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/blacksmith.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/blacksmith.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/blacksmith_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/blacksmith_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/catapult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/catapult.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/catapult_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/catapult_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/cavalry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/cavalry.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/cavalry_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/cavalry_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/coin.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/dragon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/dragon.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/dragon_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/dragon_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/guard_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/guard_tower.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/guard_tower_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/guard_tower_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/na.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/na.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/peasant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/peasant.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/peasant_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/peasant_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/resource.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/spearman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/spearman.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/spearman_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/spearman_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/stable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/stable.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/stable_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/stable_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/swordman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/swordman.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/swordman_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/swordman_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/town_hall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/town_hall.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/town_hall_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/town_hall_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/workshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/workshop.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/blue/workshop_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/blue/workshop_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/archer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/archer.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/archer_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/archer_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/archery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/archery.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/archery_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/archery_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/aviary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/aviary.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/aviary_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/aviary_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/barrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/barrack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/barrack_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/barrack_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/blacksmith.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/blacksmith.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/blacksmith_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/blacksmith_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/catapult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/catapult.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/catapult_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/catapult_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/cavalry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/cavalry.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/cavalry_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/cavalry_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/coin.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/dragon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/dragon.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/dragon_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/dragon_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/guard_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/guard_tower.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/guard_tower_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/guard_tower_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/na.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/na.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/peasant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/peasant.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/peasant_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/peasant_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/resource.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/spearman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/spearman.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/spearman_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/spearman_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/stable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/stable.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/stable_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/stable_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/swordman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/swordman.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/swordman_attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/swordman_attack.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/town_hall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/town_hall.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/town_hall_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/town_hall_build.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/workshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/workshop.png -------------------------------------------------------------------------------- /visual/public/assets/medieval/red/workshop_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/medieval/red/workshop_build.png -------------------------------------------------------------------------------- /visual/public/assets/red/barrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/barrack.png -------------------------------------------------------------------------------- /visual/public/assets/red/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/base.png -------------------------------------------------------------------------------- /visual/public/assets/red/cannon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/cannon.png -------------------------------------------------------------------------------- /visual/public/assets/red/cavalry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/cavalry.png -------------------------------------------------------------------------------- /visual/public/assets/red/defense_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/defense_tower.png -------------------------------------------------------------------------------- /visual/public/assets/red/engineer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/engineer.png -------------------------------------------------------------------------------- /visual/public/assets/red/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/factory.png -------------------------------------------------------------------------------- /visual/public/assets/red/flight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/flight.png -------------------------------------------------------------------------------- /visual/public/assets/red/hangar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/hangar.png -------------------------------------------------------------------------------- /visual/public/assets/red/resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/resource.png -------------------------------------------------------------------------------- /visual/public/assets/red/scifiUnit_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/scifiUnit_17.png -------------------------------------------------------------------------------- /visual/public/assets/red/scifiUnit_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/scifiUnit_18.png -------------------------------------------------------------------------------- /visual/public/assets/red/scifiUnit_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/scifiUnit_19.png -------------------------------------------------------------------------------- /visual/public/assets/red/scifiUnit_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/scifiUnit_21.png -------------------------------------------------------------------------------- /visual/public/assets/red/scifiUnit_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/scifiUnit_22.png -------------------------------------------------------------------------------- /visual/public/assets/red/soldier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/soldier.png -------------------------------------------------------------------------------- /visual/public/assets/red/spaceman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/spaceman.png -------------------------------------------------------------------------------- /visual/public/assets/red/spearman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/spearman.png -------------------------------------------------------------------------------- /visual/public/assets/red/tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/tank.png -------------------------------------------------------------------------------- /visual/public/assets/red/tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/tower.png -------------------------------------------------------------------------------- /visual/public/assets/red/truck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/truck.png -------------------------------------------------------------------------------- /visual/public/assets/red/worker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/worker.png -------------------------------------------------------------------------------- /visual/public/assets/red/workshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/red/workshop.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/fog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/fog.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/forest.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/grass.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/ground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/ground.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/killed_forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/killed_forest.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/mineral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/mineral.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/na.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/na.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/rock.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/sand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/sand.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/soil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/soil.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/stump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/stump.png -------------------------------------------------------------------------------- /visual/public/assets/terrain/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/assets/terrain/water.png -------------------------------------------------------------------------------- /visual/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/minirts/859e747a5e2fab2355bea083daffa6a36820a7f2/visual/public/favicon.ico -------------------------------------------------------------------------------- /visual/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /visual/src/App.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) Facebook, Inc. and its affiliates. 3 | All rights reserved. 4 | 5 | This source code is licensed under the license found in the 6 | LICENSE file in the root directory of this source tree. 7 | */ 8 | import React from 'react'; 9 | import ReactDOM from 'react-dom'; 10 | import App from './App'; 11 | 12 | it('renders without crashing', () => { 13 | const div = document.createElement('div'); 14 | ReactDOM.render(, div); 15 | ReactDOM.unmountComponentAtNode(div); 16 | }); 17 | -------------------------------------------------------------------------------- /visual/src/Grid.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) Facebook, Inc. and its affiliates. 3 | All rights reserved. 4 | 5 | This source code is licensed under the license found in the 6 | LICENSE file in the root directory of this source tree. 7 | */ 8 | import { Create, Rectangle } from "pts"; 9 | 10 | 11 | export default class Grid { 12 | 13 | constructor( bound, rows, cols ) { 14 | this._grid = Create.gridCells( bound, rows, cols ); 15 | this._rows = rows; 16 | this._cols = cols; 17 | this._cell = Rectangle.size( this._grid[0] ); 18 | } 19 | 20 | 21 | get all() { return this._grid; } 22 | get rows() { return this._rows; } 23 | get cols() { return this._cols; } 24 | get cellsize() { return this._cell.x; } 25 | get length() { return this._grid.length; } 26 | 27 | 28 | index( i ) { 29 | return this._grid[i]; 30 | } 31 | 32 | 33 | at( x, y ) { 34 | return this.index( y * this._cols + x ); 35 | } 36 | 37 | center( x, y ) { 38 | let c = (y === undefined) ? this.index(x) : this.at(x, y); 39 | return Rectangle.center( c ); 40 | } 41 | 42 | offset( x, y, off ) { 43 | let c = (y === undefined) ? this.index(x) : this.at(x, y); 44 | return c[0].$add( off ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /visual/src/index.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) Facebook, Inc. and its affiliates. 3 | All rights reserved. 4 | 5 | This source code is licensed under the license found in the 6 | LICENSE file in the root directory of this source tree. 7 | */ 8 | body { 9 | margin: 0; 10 | padding: 0; 11 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 12 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 13 | sans-serif; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | code { 19 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 20 | monospace; 21 | } 22 | -------------------------------------------------------------------------------- /visual/src/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) Facebook, Inc. and its affiliates. 3 | All rights reserved. 4 | 5 | This source code is licensed under the license found in the 6 | LICENSE file in the root directory of this source tree. 7 | */ 8 | import React from 'react'; 9 | import ReactDOM from 'react-dom'; 10 | import './index.css'; 11 | import App from './App'; 12 | import * as serviceWorker from './serviceWorker'; 13 | 14 | ReactDOM.render(, document.getElementById('root')); 15 | 16 | // If you want your app to work offline and load faster, you can change 17 | // unregister() to register() below. Note this comes with some pitfalls. 18 | // Learn more about service workers: http://bit.ly/CRA-PWA 19 | serviceWorker.unregister(); 20 | --------------------------------------------------------------------------------