GithubHelp home page GithubHelp logo

dmarcuse / edjournal Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 664 KB

A modern library for reading the Elite: Dangerous player journal

Java 100.00%
elite-dangerous java java-8 stream journal library

edjournal's Introduction

EDJournal Download Build Status

A modern library for reading the Elite: Dangerous player journal

EDJournal is an easy to use library for reading the Elite: Dangerous player journal.

With the power of Java 8 streams, you can do a lot with very little code. Here's a quick example that attempts to get the last star system you jumped into:

String currentSystem = Journal.create().lastEventOfType(FSDJump.class)
				.map(FSDJump::getStarSystem)
				.orElse("Unknown location");

And here's one that counts how many stars you've scanned in the past week:

int lastWeekStars = Journal.create().events(Scan.StarScan.class)
				.filter(s -> s.getTimestamp()
				.isAfter(Instant.now().minus(Duration.ofDays(7))))
				.count());

And maybe you're curious about how many credits you've earned from bounty hunting?

long bountyHuntingCredits = Journal.create().events(RedeemVoucher.class)
				.filter(v -> v.getType() == VoucherType.Bounty)
				.mapToLong(RedeemVoucher::getAmount).sum()

You can also watch events live as they come in:

Journal.create().liveEvents(FSDJump.class).forEach(j -> System.out.println("You jumped to " + j.getStarSystem()));

Warning

EDJournal is a brand new library and has the ambitious goal of supporting the entire journal specification. It likely has numerous problems that I haven't found yet, so if you have any problems please submit an issue report so I can fix it!

edjournal's People

Contributors

dmarcuse avatar

Stargazers

 avatar  avatar

Watchers

 avatar

edjournal's Issues

Maven Dependency management of the JAR

I've a tried incorporating this code into a project I'm building myself however I'm having a lot of issues surrounding the downloading of the necessary JAR. The maven dependency tag as is does not seem to work (it does not appear on central) and the addition from bintray into the settings file did pull down gson and the other dependencies but not the core jar you need to compile the example code in the readme.

Do you have a step by step set of instructions for this? or is there something I'm missing. The only thing that seemed to work was manually running the gradle builds and adding the JAR that way but that's not really an option for what I'm trying to do. having Maven manage the dependencies would be more ideal.

I can give you more info if needed but any help is much appreciated. This library would be very useful for me.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.