Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign CoC module #22

Open
Pythonic-Rainbow opened this issue Sep 22, 2024 · 1 comment
Open

Redesign CoC module #22

Pythonic-Rainbow opened this issue Sep 22, 2024 · 1 comment

Comments

@Pythonic-Rainbow
Copy link
Member

Instead of ClanUtil, use ClanDelta and extension methods

e.g. Coc.GetMember -> Clan.GetMember (by using extension methods)
comparing 2 clan instances in order to see who left clan/donated stuff: Methods/Properies in ClanDelta

During Coc module init, fetch clan info once and ClanDelta clanDelta = new(clan);
For each poll, clanDelta.compare(newClan). and then compute stuff like clanDelta.membersLeft

@Pythonic-Rainbow
Copy link
Member Author

Pythonic-Rainbow commented Dec 9, 2024

After reviewing the TODOs, if really giveup SQLite Trigger approach:

In Db.cs, Create events and implement a callback for each event
In DbObj impl classes, call those events

e.g.
Override Account.Insert {
Db.EventMainInsert();
}


Or simply just
Override Account.insert {
Main main = new();
main.Insert()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant