aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-09move process_* out of lib.rsDaniel Schadt
This is the start of an effort to clean up lib.rs a bit by moving out functions into their own module and re-exporting them.
2020-05-09update changelogDaniel Schadt
2020-05-09update documentation and READMEDaniel Schadt
2020-05-09add process_stream and process_file functionsDaniel Schadt
2020-05-08add first support for determining CMsDaniel Schadt
This still needs a bit of work, as some of them are untested (Conjured Amalgamate, Fractal CMs).
2020-05-04bump version to 0.3.1v0.3.1Daniel Schadt
2020-05-04update changelogDaniel Schadt
2020-05-04implement FromStr for Profession and EliteSpecDaniel Schadt
For the same reason that Boss implements FromStr, we might want users to be able to specify professions or elite specializations in textual form.
2020-05-03remove fnv dependencyDaniel Schadt
fnv was used in the old statistics module, which has been removed. Therefore, we no longer need or use fnv.
2020-05-02bump version to 0.3.0v0.3.0Daniel Schadt
2020-05-02fix formattingDaniel Schadt
2020-05-02update changelogDaniel Schadt
2020-05-02add docs about parse_events and the parserDaniel Schadt
2020-05-02implement From<Evtc> for PartialEvtcDaniel Schadt
We can always do this conversion, because we can just throw away the events field. The other way around is not possible, as we need a file to parse the events from.
2020-05-02implement Hash, Default, PartialEq for raw typesDaniel Schadt
2020-05-02update READMEDaniel Schadt
2020-05-02add a note about writing evtc filesDaniel Schadt
2020-05-02use getters for EventDaniel Schadt
2020-05-02add more documentationDaniel Schadt
2020-05-01add a comment about redundant closuresDaniel Schadt
2020-05-01take readers by valueDaniel Schadt
The API guidelines for Rust state that readers should be taken by value[1]. If the caller wants to re-use the reader, they have to borrow it. This patch adjusts the parsing functions to do just that. [1]: https://rust-lang.github.io/api-guidelines/interoperability.html#generic-readerwriter-functions-take-r-read-and-w-write-by-value-c-rw-value
2020-04-30Cargo: only include sourcesDaniel Schadt
The source code itself is pretty small, however, the repository also contains >40MB of test data in the form of evtc log files. We don't want all consumers of this library to download all of this test data just because they want to use the library. This commit excludes everything except for the source (and some metadata files) from the cargo package, allowing a thin distribution. The git repository will still contain the tests, and the CI will still run them.
2020-04-29fix long number literalDaniel Schadt
2020-04-29force clippy to fail on warningsDaniel Schadt
There is "cargo clippy -- -D warnings", but that stops after the first warning - and it displays them as an error. Not really the best solution. The hacky workaround here is to make the script have a non-zero return status when it found warnings, but still display them as warnings only.
2020-04-29enable gitlab CIDaniel Schadt
2020-04-29bump version to 0.2.0v0.2.0Daniel Schadt
2020-04-29update changelogDaniel Schadt
2020-04-29add some convenience methods to LogDaniel Schadt
Those are methods that are probably useful to some applications, and it feels like some of that data should even be in the file header. Due to the evtc limitations though, we need to loop through the events to access it, which means that every application would have to implement this. Those functions should be kept in a separate impl though, as they are more costly to call than the other accessors. Maybe they should even be moved to an "extension trait", though it's not clear whether putting this behind a trait would be idiomatic Rust. The advantage would be that users would have to specifically import the trait, thereby making sure they're aware of the performance implications.
2020-04-29formatting fixesDaniel Schadt
2020-04-29implement TryFrom for non-referencesDaniel Schadt
2020-04-29delete main.rsDaniel Schadt
This file was a big mess of different local experiments of playing around with the API. It didn't get updated with the rest of evtclib and consisted of 80% commented lines that once tested something and are now useless. We can have a nice small main.rs in the future that can be used to print out some basic information about a given log file, or rely on examples to demonstrate the API capabilities. But this abomination that was main.rs should be gone.
2020-04-29replace own from_raw with TryFrom implementationDaniel Schadt
Hooking into the standard Rust system is probably better in the long-run than having those separate from_raw methods on all of our objects. Most end users probably won't even need them, as they will use the higher level functionality provided by evtclib::process.
2020-04-29make event submodule publicDaniel Schadt
The module contains some useful structs which were otherwise not exposed in the public API, so it's better to make it public. The re-export of Event and EventKind can stay, for convenience.
2020-04-29implement TeamChange, AttackTarget and TargetableDaniel Schadt
2020-04-28more inliningDaniel Schadt
2020-04-28add more shorthands to Agent<Player|...>Daniel Schadt
2020-04-28update changelogDaniel Schadt
2020-04-28derive Hash for WeaponSet and ActivationDaniel Schadt
2020-04-28implement Position/Velocity/Facing/MapId eventsDaniel Schadt
2020-04-28fix documentation for CbtStatechangeDaniel Schadt
2020-04-28add integration-style tests for each bossDaniel Schadt
This makes sure that at least the basic functionality is working. The logs are "real world" logs, unmodified, directly from arcdps. Some of the names have special characters in them, so that part of the code is tested as well.
2020-04-28more documentationDaniel Schadt
2020-04-28restructure how agents are constructedDaniel Schadt
The old function turned a bit into a mess, so the functionality is now split up.
2020-04-28move boss_id() to encounter_id(), add encounter()Daniel Schadt
2020-04-28add Profession and EliteSpec enumDaniel Schadt
In the high-level "Player" struct, dealing with the low-level numbers seems a bit off, especially because it means that applications have to keep a table of id-to-profession mappings anyway. We're already including a Boss enum for the same reasons, so we might as well include Profession and EliteSpec data - which is also not changing as frequently as Boss.
2020-04-28derive Hash for Player/Gadget/Character/AgentDaniel Schadt
It is very much possible and likely that someone would want to use a Player or Agent in a HashSet or HashMap, and there's no reason why that should be forbidden.
2020-04-28getters for Player/Character/GadgetDaniel Schadt
2020-04-28more documentation for AgentDaniel Schadt
2020-04-28rework Agent/AgentName/AgentKind structsDaniel Schadt
We can now make compile-time guarantees about the contained kind, so that Log::players for example can return players directly.
2020-04-27rework Log::players/npcsDaniel Schadt
Since we know that we're only returning Agents which are Players, we can save downstream users some time and also provide access to the &Player. Ideally, we'd want something like PlayerAgent, or Agent<Player>, but that not only incurrs code duplication (in the first case), it'd also mean cloning the player data (second case), as we couldn't just return a reference into the pool with all agents. For now, this is still the better option, until other ways have been explored. Maybe cloning here wouldn't be too bad, but we'd also run into the issue that we cannot use record unpacking for records that have different generic parameters, so going from Agent<AgentKind> to Agent<Player> would mean manually copying over all record fields. We now no longer need the matches! macro, as we can simply use AgentKind::as_{player,character}.