Comments (6)
- manipulators should not let client card to add event at any moment
- an event can only be registered if it will be correct when
- the minion got silenced
- the minion got copied
- the lifetime of an enchantment
- lifetime begins at
- minion is summoned
- minion is copied
- call 'AfterAdded()'
- lifetime ends at
- minion is silenced
- minion is not in hand/play zone
- call 'AfterRemoved'
- but the registered event cannot be removed here (limited of event manager)
- lifetime begins at
from hearthstone-ai.
Solutions
- Event manager should be able to remove a specified event trigger
- so an enchantment bound with an event can un-register that event when got silenced
- implement enchantment card as another state::Cards::Card
- when enchantment is removed, also removed the card from PLAY zone to GRAVEYARD zone
- when the event is triggered, check the associate enchantment card
from hearthstone-ai.
A class called EventListener
A minion can have several EventListener
Methods of EventListener:
- Register
- Unregister
Event manager should return event identifier so caller can remove it afterwards
Card manipulator provides interface to add an event listener
Each enchantment is a kind of event listener
It might listen to nothing
In this case, the unregister callback is a nullptr
Aura and enchantment are both a kind of event listener
Maybe we can unify them
When a minion is silenced, all its enchantment and aura are removed
That is, the event listeners are removed
When a minion is copied
The event listener are either removed, or reregistered
from hearthstone-ai.
EventListener can be written in namespace state
maybe right aside to the event manager
maybe the 'added_to_zone' callback can be removed
state::ZoneChanger invoke the 'register' and 'unregister' methods of the event listeners
maybe define a compile-time template enum to states the lifetime policy
from hearthstone-ai.
Decided not to remove a attached event. An event can only be removed by itself.
A event-hooked enchantment will be implemented.
Such enchantments should be with a play order. And the field 'silenced' should become 'silenced_at_play_order'. So the event callback can check if it is silenced.
from hearthstone-ai.
Event-hooked enchantment is fixed in commits: ab6ab60 b1e2108 9e905e2
from hearthstone-ai.
Related Issues (20)
- generate_train_data depends on `neural_net`, where does `neural_net` come from? HOT 1
- Compilation with VS 2017 community (Windows)? HOT 9
- Metadata file 'GameEngineCppCLI.dll' could not be found HOT 1
- You are a bad person and should be isolated.
- run 'make' under generate_train_data failed
- What do resource feature represent in the game?
- judge: refine Recorder HOT 1
- Binaries HOT 1
- move mcts::board::* to engine module HOT 1
- randomize hidden information in judger HOT 1
- refine neural network implementation
- don't need to use double here
- integrate with TensorFlow C++ HOT 6
- I can't follow Installation process HOT 2
- Needs Simulator so we don't need the actual game to train data. HOT 3
- It is not working HOT 2
- BadImageFormatException when trying to run HearthstoneAI
- Building on macOS HOT 1
- contact email HOT 1
- Binaries?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hearthstone-ai.