summaryrefslogtreecommitdiffstats
path: root/examples/statemachine
Commit message (Collapse)AuthorAgeFilesLines
* Update contact URL in license headers.Jason McDonald2009-08-129-9/+9
| | | | Reviewed-by: Trust Me
* Compile fix with namespaceshjk2009-08-101-0/+2
|
* Doc: Integrated the Rogue (state machine) example.Geir Vattekar2009-08-076-0/+465
| | | | Reviewed-by: Kent Hansen
* Remove tank game exampleEskil Abrahamsen Blomfeldt2009-07-2827-2396/+1
| | | | | | | | | After discussions with product management, it was considered best that this example be removed until it can be improved. There are some bugs an irregularities that should be cleaned up, and the theme should be made less violent. Reviewed-by: Volker Hilsheimer
* Make QStateMachine inherit QStateKent Hansen2009-07-222-5/+5
| | | | | | | | | | | | | | | | | | This removes the need for a "root state" in the machine; or rather, the machine _is_ the root state. User code can now pass in a QStateMachine directly to the QState constructor, instead of machine->rootState(). This also means we could get rid of the "proxying" from the machine to the root state for things like properties (initialState et al), finished() signal and auto-reparenting of states (the ChildAdded event hack). A fun little side-effect of this change is that it's now possible to embed state machines within state machines. We can't think of a good use case yet where you would rather embed a stand-alone state machine (with its own event processing etc.) rather than having just a regular nested state, but it's neat and it works. Reviewed-by: Eskil Abrahamsen Blomfeldt
* Update license headers in files that are new in 4.6.Jason McDonald2009-06-1724-48/+48
| | | | Reviewed-by: Trust Me
* Merge license header changes from 4.5Volker Hilsheimer2009-06-161-2/+2
|
* WinCE doesn't have time() function, use QTimeKent Hansen2009-06-091-3/+2
|
* kill usage of QT_STATEMACHINE_SOLUTIONKent Hansen2009-06-045-25/+0
| | | | The define no longer exists.
* Fix missing/outdated license headers.Jason McDonald2009-05-2120-79/+896
| | | | Reviewed-by: Trust Me
* fix compiler warningsKent Hansen2009-05-201-1/+1
|
* compile with -qtnamespace, clean up the example .pro filesKent Hansen2009-05-209-41/+53
|
* remove the citizenquartz exampleKent Hansen2009-05-2014-956/+0
| | | | It's not done yet, so let's re-add it when it is.
* Make QAbstractTransition::eventTest() non-constEskil Abrahamsen Blomfeldt2009-05-145-10/+10
| | | | | We decided to remove the const of the eventTest() since some transitions have dynamic conditions and need to update when eventTest() is called.
* Pop up message when a tank wins the gameEskil Abrahamsen Blomfeldt2009-05-147-12/+111
| | | | | Also fixed: Added some docs and moved the tanks a little so they don't start partly outside the scene rect.
* Fix run-time error in Seek AI's state machineEskil Abrahamsen Blomfeldt2009-05-141-1/+5
| | | | | Passed parent as 'tank', thus getting a null parent in the GoToLocation state, which breaks the machine when you transition into the state.
* Fix SpinState in Tank Game Example to spin more than 180 degreesEskil Abrahamsen Blomfeldt2009-05-142-2/+12
| | | | This was a leftover from when the setDirection() semantics were broken.
* document statemachine/factorial exampleKent Hansen2009-05-131-26/+38
|
* doc: Correct names of snippets in docs for Tank Game exampleEskil Abrahamsen Blomfeldt2009-05-131-0/+4
|
* document the statemachine/eventtransitions exampleKent Hansen2009-05-121-1/+15
|
* Change name of "errorstate" example to "tankgame"Eskil Abrahamsen Blomfeldt2009-05-1226-29/+40
| | | | | The error state is not a big enough part of the example to justify naming it after it.
* Fixes: document statemachine/twowaybutton exampleKent Hansen2009-05-121-7/+15
|
* kill some simplistic/overlapping/under-developed examplesKent Hansen2009-05-129-445/+0
|
* document the statemachine/pingpong exampleKent Hansen2009-05-121-0/+14
|
* improve the docs for the trafficlight exampleKent Hansen2009-05-121-25/+22
|
* Make selecting plugins more user friendly and platform independentEskil Abrahamsen Blomfeldt2009-05-115-18/+66
| | | | | | Using *.dll was just a placeholder here. The code is mostly copied from the Plug&Paint example, and goes through all the plugins to find the compatible ones with some hacks to find out the application directory on windows and mac.
* Add chase state and ability to detect and fire at other tanks. This reveals anEskil Abrahamsen Blomfeldt2009-05-062-4/+92
| | | | assert in the state machine which needs to be debugged.
* Avoid passage where the walls meet the edge of the scene rect.Eskil Abrahamsen Blomfeldt2009-05-061-5/+6
|
* get rid of marginKent Hansen2009-05-051-1/+2
|
* add event as argument to onEntry(), onExit() and onTransition()Kent Hansen2009-05-058-16/+16
| | | | | | | | | Accessing the event can be useful. E.g., onEntry() can do some common event processing regardless of which transition caused the state to be entered; onTransition() can be used in combination with eventTest(), where eventTest() would first check that the input matches some criteria, and then the actual processing of that input would be done in onTransition.
* Add randomness.Eskil Abrahamsen Blomfeldt2009-05-051-2/+2
|
* Make sure target state is set correctly. Also make sure eventTest() actuallyEskil Abrahamsen Blomfeldt2009-05-051-5/+8
| | | | overrides the virtual function.
* Set collidedLine for the implicit walls around the scene to allow for collisionEskil Abrahamsen Blomfeldt2009-05-051-4/+21
| | | | response.
* Make sure the correct position/direction is actually set at the end of aEskil Abrahamsen Blomfeldt2009-05-051-10/+16
| | | | loop. Also make sure we set the direction to an angle within 360 degrees.
* Fix support reverse actions. Logic was broken and would always return falseEskil Abrahamsen Blomfeldt2009-05-051-2/+2
| | | | immediately for reverse actions, thus immediately stopping them.
* Add unfinished "more advanced" AI for errorstate.Eskil Abrahamsen Blomfeldt2009-04-306-5/+184
|
* Make design better. Remove the Tank interface. This is now an implicit interfaceEskil Abrahamsen Blomfeldt2009-04-3016-86/+65
| | | | based on the meta-object system.
* Add two AIs: They are both designed to do the same. Spin until they see a tankEskil Abrahamsen Blomfeldt2009-04-3014-26/+262
| | | | | | and then fire. One of them has an error, which causes it to enter its error state. The errorstate example has been changed to handle this by disabling the tank. The rest of the tanks will keep working.
* Compile against new QState::ChildMode API.Eskil Abrahamsen Blomfeldt2009-04-291-1/+1
|
* Kill gameOver signal as it was only used when you clicked the stop actionEskil Abrahamsen Blomfeldt2009-04-292-9/+6
|
* replace QState::Type with QState::childMode propertyKent Hansen2009-04-292-2/+2
| | | | Result of API review.
* Adapt to recent API changes and bug fixes.Eskil Abrahamsen Blomfeldt2009-04-291-2/+6
|
* make history state constructibleKent Hansen2009-04-291-1/+1
| | | | | | | | | | | Decided in API review. The intention of QHistoryState not being constructible was so that people wouldn't subclass it and reimplement onEntry()/onExit(), thinking that those functions would actually get called (which they won't). However, we recently added the entered() signal to QAbstractState, so people are going to connect to it and ask why they never get the signal for a QHistoryState. We might as well make QHistoryState constructible and just document that it doesn't make sense to subclass it.
* say hello (again) to QAbstract{State,Transition}::machine()Kent Hansen2009-04-292-37/+18
| | | | It's useful and it's simple for us to expose, so let's.
* Work around an oddity in parallel states that causes all regions to exitEskil Abrahamsen Blomfeldt2009-04-281-4/+4
| | | | | if there is a transition from one of them (even if the target state of the transition is inside the region.)
* Some updates to the errorstate example.Eskil Abrahamsen Blomfeldt2009-04-2812-126/+270
| | | | | | Added cannon firing. There are some problems left: For some reason the parallel state group does not work properly, so only one tank moves even if you add more. There also seems to be something wrong with historyState->setDefaultState().
* compile after api changesKent Hansen2009-04-282-6/+6
|
* Really broken plugin for errorState. Don't try to use this yet, it doesn'tEskil Abrahamsen Blomfeldt2009-04-243-0/+115
| | | | work at all.
* Unfinished tank AI game. The idea is that you plug in AIs for the tanks, andEskil Abrahamsen Blomfeldt2009-04-248-0/+619
| | | | | one such plugin will have a run time error, so the game server needs to use errorState for handling errors.
* kill the stateactions apiKent Hansen2009-04-222-5/+5
| | | | | | | | | | | | It just didn't give us that much. Typically you just reimplement onEntry/onExit/onTransition when you want to do something. We go back to the signals-and-slots approach: states have entered() and exited() signals that you can connect to. It's still possible to have an action-based API, but then you build it on top of the core API, which is OK. Replacing 4 public classes (and one layer in the hierarchy) with 2 signals feels good.