public GameEngine(IGameCanvas gc) { gameCanvas = gc; gameCanvas.Init(); thread = new Thread(new ThreadStart(run)); thread.Start(); }
public void Initialize(IGameCanvas gameCanvas) { _gameCanvas = gameCanvas; var msgParent = _gameCanvas.GetSystemMsgParent(); if (msgParent) { msgParent.anchoredPosition = new Vector2(0, HidePosition); } }
public void Inject( IAppContext context, IGameCanvas gameCanvas, ITaskManager taskManager, IResourceManager resourceManager, DialogFactory dialogFactory) { _context = context; _gameCanvas = gameCanvas; _task = taskManager; _dialogFactory = dialogFactory; _resource = resourceManager; _autoShowDialogNameAndFunc.Add(DialogName.CheckinDialog, AutoShowCheckinDialog); _autoShowDialogNameAndFunc.Add(DialogName.UserTaskDialog, AutoShowUserTaskDialog); }
public MinesweeperBoard(IGameCanvas gc, int2 size, int bombCnt) { _gc = gc; _boardSize = size; _bombCount = bombCnt; // 一箇所でも開けられるか 本当はassert以外がいい? Debug.Assert(_boardSize.x * _boardSize.y > _bombCount); // 変数の初期化 _isOpen = new bool[_boardSize.y, _boardSize.x]; _isBomb = new bool[_boardSize.y, _boardSize.x]; _isFlag = new bool[_boardSize.y, _boardSize.x]; _cntAroundBomb = new int[_boardSize.y, _boardSize.x]; _cntClosedCell = _boardSize.x * _boardSize.y; }
public void Inject( IAppController appController, INetworkManager network, IGameCanvas gameCanvas, ITaskManager taskManager, IDialogManager dialogManager, IPayManager payManager, IAnalyticManager analyticManager, ISystemMsgController systemMsgController, ISoundController soundController, IWeChatManager weChatManager, RemoteAPI remoteAPI, ConfigHolder configHolder, IosSDK iosSDK, IPIPLogic pipLogic, IClipboardManager clipboardManager, ISocketFactory socketFactory, IMessageRouter messageRouter, IMsgRepo msgRepo, XiaoMiManager xiaoMiManager, IResourceManager resourceManager, IDataRepository dataRepository) { _network = network; _taskManager = taskManager; _appController = appController; _gameCanvas = gameCanvas; _dialogManager = dialogManager; _payManager = payManager; _analyticManager = analyticManager; _systemMsgController = systemMsgController; _soundController = soundController; _weChatManager = weChatManager; _remoteAPI = remoteAPI; _configHolder = configHolder; _iosSDK = iosSDK; _socketFactory = socketFactory; _pipLogic = pipLogic; _messageRouter = messageRouter; _msgRepo = msgRepo; _xiaoMiManager = xiaoMiManager; _dataRepository = dataRepository; _clipboardManager = clipboardManager; _resourceManager = resourceManager; }
private void InitializeComponent() { Logger.WriteLine(Logger.Stage.INIT_MAIN, "new ComponentResourceManager..."); ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(RogueForm)); Logger.WriteLine(Logger.Stage.INIT_MAIN, "creating GameCanvas..."); #if OBSOLETE if (SetupConfig.Video == SetupConfig.eVideo.VIDEO_MANAGED_DIRECTX) { Logger.WriteLine(Logger.Stage.INIT_MAIN, "DXGameCanvas implementation..."); m_GameCanvas = new DXGameCanvas(); } else { #endif Logger.WriteLine(Logger.Stage.INIT_MAIN, "GDIPlusGameCanvas implementation..."); m_GameCanvas = new GDIPlusGameCanvas(); #if OBSOLETE } #endif Logger.WriteLine(Logger.Stage.INIT_MAIN, "SuspendLayout..."); SuspendLayout(); Logger.WriteLine(Logger.Stage.INIT_MAIN, "setup GameCanvas..."); m_GameCanvas.NeedRedraw = true; UserControl userControl = m_GameCanvas as UserControl; userControl.Location = new Point(279, 83); userControl.Name = "canvasCtrl"; userControl.Size = new Size(150, 150); userControl.TabIndex = 0; Logger.WriteLine(Logger.Stage.INIT_MAIN, "setup RogueForm"); AutoScaleMode = AutoScaleMode.None; ClientSize = new Size(800, 600); Controls.Add(userControl); Icon = (Icon)componentResourceManager.GetObject("$this.Icon"); Name = "RogueForm"; StartPosition = FormStartPosition.CenterScreen; Text = SetupConfig.GAME_NAME; WindowState = FormWindowState.Maximized; Logger.WriteLine(Logger.Stage.INIT_MAIN, "ResumeLayout"); ResumeLayout(false); Logger.WriteLine(Logger.Stage.INIT_MAIN, "InitializeComponent() done."); }
public void Initialize( IGameCanvas gameCanvas, IDialogManager dialogManager, IResourceManager resourceManager, LoginModeWindow.Factory loginModeWindowFactory, PortalWindow.Factory portalWindowFactory, RoomWindow.Factory roomWindowFactory, SeatWindow.Factory seatWindowFactory, GameWindow.Factory gameWindowFactory) { _gameCanvas = gameCanvas; _dialogManager = dialogManager; _resource = resourceManager; _loginModeWindowFactory = loginModeWindowFactory; _portalWindowFactory = portalWindowFactory; _roomWindowFactory = roomWindowFactory; _seatWindowFactory = seatWindowFactory; _gameWindowFactory = gameWindowFactory; }
public void Initialize(IGameCanvas gameCanvas) { _gameCanvas = gameCanvas; }
/// <summary> /// <see cref="DrawImageWithAnchor"/>を使うときの描画する画像の左上の座標を計算します。 /// </summary> /// <param name="gc"></param> /// <param name="image">GcImage</param> /// <param name="anchor">GcAnchor</param> /// <param name="padding">指定したアンカーから右下方向にどれだけずらすか</param> /// <returns>左上座標</returns> /// <exception cref="ArgumentOutOfRangeException"></exception> public static float2 CalcImageUpperLeftPosition(this IGameCanvas gc, in GcImage image, in GcAnchor anchor, in float2 padding)