Changeset View
Changeset View
Standalone View
Standalone View
libkdegamesprivate/kgame/kgameio.h
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Line(s) | 196 | public: | |||
---|---|---|---|---|---|
217 | KGameKeyIO(QWidget *parent); | 217 | KGameKeyIO(QWidget *parent); | ||
218 | virtual ~KGameKeyIO(); | 218 | virtual ~KGameKeyIO(); | ||
219 | 219 | | |||
220 | /** | 220 | /** | ||
221 | * The identification of the IO | 221 | * The identification of the IO | ||
222 | * | 222 | * | ||
223 | * @return KeyIO | 223 | * @return KeyIO | ||
224 | */ | 224 | */ | ||
225 | int rtti() const Q_DECL_OVERRIDE; | 225 | int rtti() const override; | ||
226 | 226 | | |||
227 | Q_SIGNALS: | 227 | Q_SIGNALS: | ||
228 | /** | 228 | /** | ||
229 | * Signal handler for keyboard events. This function is called | 229 | * Signal handler for keyboard events. This function is called | ||
230 | * on every keyboard event. If appropriate it can generate a | 230 | * on every keyboard event. If appropriate it can generate a | ||
231 | * move for the player the device belongs to. If this is done | 231 | * move for the player the device belongs to. If this is done | ||
232 | * and the event is eaten eatevent needs to be set to true. | 232 | * and the event is eaten eatevent needs to be set to true. | ||
233 | * What move you generate (i.e. what you write to the stream) | 233 | * What move you generate (i.e. what you write to the stream) | ||
Show All 13 Lines | |||||
247 | * @param eatevent set this to true if we processed the event | 247 | * @param eatevent set this to true if we processed the event | ||
248 | */ | 248 | */ | ||
249 | void signalKeyEvent(KGameIO *io,QDataStream &stream,QKeyEvent *m,bool *eatevent); | 249 | void signalKeyEvent(KGameIO *io,QDataStream &stream,QKeyEvent *m,bool *eatevent); | ||
250 | 250 | | |||
251 | protected: | 251 | protected: | ||
252 | /** | 252 | /** | ||
253 | * Internal method to process the events | 253 | * Internal method to process the events | ||
254 | */ | 254 | */ | ||
255 | bool eventFilter( QObject *o, QEvent *e ) Q_DECL_OVERRIDE; | 255 | bool eventFilter( QObject *o, QEvent *e ) override; | ||
256 | 256 | | |||
257 | private: | 257 | private: | ||
258 | friend class KGameKeyIOPrivate; | 258 | friend class KGameKeyIOPrivate; | ||
259 | KGameKeyIOPrivate *const d; | 259 | KGameKeyIOPrivate *const d; | ||
260 | 260 | | |||
261 | Q_DISABLE_COPY(KGameKeyIO) | 261 | Q_DISABLE_COPY(KGameKeyIO) | ||
262 | }; | 262 | }; | ||
263 | 263 | | |||
Show All 34 Lines | 275 | public: | |||
298 | * @param b true = tracking on | 298 | * @param b true = tracking on | ||
299 | */ | 299 | */ | ||
300 | void setMouseTracking(bool b); | 300 | void setMouseTracking(bool b); | ||
301 | /** | 301 | /** | ||
302 | * The identification of the IO | 302 | * The identification of the IO | ||
303 | * | 303 | * | ||
304 | * @return MouseIO | 304 | * @return MouseIO | ||
305 | */ | 305 | */ | ||
306 | int rtti() const Q_DECL_OVERRIDE; | 306 | int rtti() const override; | ||
307 | 307 | | |||
308 | Q_SIGNALS: | 308 | Q_SIGNALS: | ||
309 | /** | 309 | /** | ||
310 | * Signal handler for mouse events. This function is called | 310 | * Signal handler for mouse events. This function is called | ||
311 | * on every mouse event. If appropriate it can generate a | 311 | * on every mouse event. If appropriate it can generate a | ||
312 | * move for the player the device belongs to. If this is done | 312 | * move for the player the device belongs to. If this is done | ||
313 | * and the event is eaten eatevent needs to be set to true. | 313 | * and the event is eaten eatevent needs to be set to true. | ||
314 | * @see signalKeyEvent | 314 | * @see signalKeyEvent | ||
Show All 11 Lines | |||||
326 | * @param eatevent set this to true if we processed the event | 326 | * @param eatevent set this to true if we processed the event | ||
327 | */ | 327 | */ | ||
328 | void signalMouseEvent(KGameIO *io,QDataStream &stream,QMouseEvent *m,bool *eatevent); | 328 | void signalMouseEvent(KGameIO *io,QDataStream &stream,QMouseEvent *m,bool *eatevent); | ||
329 | 329 | | |||
330 | protected: | 330 | protected: | ||
331 | /** | 331 | /** | ||
332 | * Internal event filter | 332 | * Internal event filter | ||
333 | */ | 333 | */ | ||
334 | bool eventFilter( QObject *o, QEvent *e ) Q_DECL_OVERRIDE; | 334 | bool eventFilter( QObject *o, QEvent *e ) override; | ||
335 | 335 | | |||
336 | private: | 336 | private: | ||
337 | friend class KGameMouseIOPrivate; | 337 | friend class KGameMouseIOPrivate; | ||
338 | KGameMouseIOPrivate *const d; | 338 | KGameMouseIOPrivate *const d; | ||
339 | 339 | | |||
340 | Q_DISABLE_COPY(KGameMouseIO) | 340 | Q_DISABLE_COPY(KGameMouseIO) | ||
341 | }; | 341 | }; | ||
342 | 342 | | |||
Show All 34 Lines | 357 | public: | |||
377 | */ | 377 | */ | ||
378 | virtual ~KGameProcessIO(); | 378 | virtual ~KGameProcessIO(); | ||
379 | 379 | | |||
380 | /** | 380 | /** | ||
381 | * The identification of the IO | 381 | * The identification of the IO | ||
382 | * | 382 | * | ||
383 | * @return ProcessIO | 383 | * @return ProcessIO | ||
384 | */ | 384 | */ | ||
385 | int rtti() const Q_DECL_OVERRIDE; | 385 | int rtti() const override; | ||
386 | 386 | | |||
387 | /** | 387 | /** | ||
388 | * Send a message to the process. This is analogous to the sendMessage | 388 | * Send a message to the process. This is analogous to the sendMessage | ||
389 | * commands of KGame. It will result in a signal of the computer player | 389 | * commands of KGame. It will result in a signal of the computer player | ||
390 | * on which you can react in the process player. | 390 | * on which you can react in the process player. | ||
391 | * | 391 | * | ||
392 | * @param stream - the actual data | 392 | * @param stream - the actual data | ||
393 | * @param msgid - the id of the message | 393 | * @param msgid - the id of the message | ||
Show All 17 Lines | |||||
411 | /** | 411 | /** | ||
412 | * Init this device by setting the player and e.g. sending an | 412 | * Init this device by setting the player and e.g. sending an | ||
413 | * init message to the device. Calling this function will emit | 413 | * init message to the device. Calling this function will emit | ||
414 | * the IOAdded signal on which you can react and initilise the | 414 | * the IOAdded signal on which you can react and initilise the | ||
415 | * computer player. | 415 | * computer player. | ||
416 | * This function is called automatically when adding the IO to | 416 | * This function is called automatically when adding the IO to | ||
417 | * a player. | 417 | * a player. | ||
418 | */ | 418 | */ | ||
419 | void initIO(KPlayer *p) Q_DECL_OVERRIDE; | 419 | void initIO(KPlayer *p) override; | ||
420 | 420 | | |||
421 | /** | 421 | /** | ||
422 | * Notifies the IO device that the player's setTurn had been called | 422 | * Notifies the IO device that the player's setTurn had been called | ||
423 | * Called by KPlayer. You can react on the @ref signalPrepareTurn to | 423 | * Called by KPlayer. You can react on the @ref signalPrepareTurn to | ||
424 | * prepare a message for the process, i.e. either update it on | 424 | * prepare a message for the process, i.e. either update it on | ||
425 | * the changes made to the game since the last turn or the initIO | 425 | * the changes made to the game since the last turn or the initIO | ||
426 | * has been called or transmit your gamestatus now. | 426 | * has been called or transmit your gamestatus now. | ||
427 | * | 427 | * | ||
428 | * @param turn is true/false | 428 | * @param turn is true/false | ||
429 | */ | 429 | */ | ||
430 | void notifyTurn(bool turn) Q_DECL_OVERRIDE; | 430 | void notifyTurn(bool turn) override; | ||
431 | 431 | | |||
432 | protected: | 432 | protected: | ||
433 | /** | 433 | /** | ||
434 | * Internal combined function for all message handling | 434 | * Internal combined function for all message handling | ||
435 | **/ | 435 | **/ | ||
436 | void sendAllMessages(QDataStream &stream,int msgid, quint32 receiver, quint32 sender, bool usermsg); | 436 | void sendAllMessages(QDataStream &stream,int msgid, quint32 receiver, quint32 sender, bool usermsg); | ||
437 | 437 | | |||
438 | protected Q_SLOTS: | 438 | protected Q_SLOTS: | ||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 517 | public: | |||
518 | /** | 518 | /** | ||
519 | * Creates a LOCAL computer player | 519 | * Creates a LOCAL computer player | ||
520 | * | 520 | * | ||
521 | */ | 521 | */ | ||
522 | KGameComputerIO(); | 522 | KGameComputerIO(); | ||
523 | KGameComputerIO(KPlayer* player); | 523 | KGameComputerIO(KPlayer* player); | ||
524 | ~KGameComputerIO(); | 524 | ~KGameComputerIO(); | ||
525 | 525 | | |||
526 | int rtti() const Q_DECL_OVERRIDE; | 526 | int rtti() const override; | ||
527 | 527 | | |||
528 | /** | 528 | /** | ||
529 | * The number of advance calls until the player (or rather: the IO) | 529 | * The number of advance calls until the player (or rather: the IO) | ||
530 | * does something (default: 1). | 530 | * does something (default: 1). | ||
531 | **/ | 531 | **/ | ||
532 | void setReactionPeriod(int advanceCalls); | 532 | void setReactionPeriod(int advanceCalls); | ||
533 | int reactionPeriod() const; | 533 | int reactionPeriod() const; | ||
534 | 534 | | |||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |