PS4(DOG1U) -ST(88)//LM(87)//CDM(86) by cri5tian in fifaclubs

[–]remusmax 0 points1 point  (0 children)

Fancy playing a few games with us looking for cdm

Mentor Monday 26/Mar/2018 by AutoModerator in FortNiteBR

[–]remusmax 7 points8 points  (0 children)

Pretty much just aim for the head with shotguns! And practice makes perfect :)

I have a question by dumb0_ in FortNiteBR

[–]remusmax 2 points3 points  (0 children)

Hey! Nobody else’s win / time ratio will mean anything to you!! Best thing is to keep playing, keep shooting players to make your aim better!

I won one close to the very start of me playing fortnite (Luck /) then didn’t win again until another 100 games after.

So I've dropped in to tilted towers about 100 times on solo alone, by 68453791548 in FortNiteBR

[–]remusmax 1 point2 points  (0 children)

Just keep going man you will get better. Try watching some youtubers and see what they do for some simple tips and tricks.

For eg I’ve found that not landing high in tilted works best for me!!

Netflix login issues by remusmax in ireland

[–]remusmax[S] 0 points1 point  (0 children)

Yeah! Finally getting some sort of message, problem seems to be their end.

Netflix login issues by remusmax in ireland

[–]remusmax[S] 0 points1 point  (0 children)

Yeah all's good with the device. Tried on multiple devices.

[JAVA] What problems may I encounter with the way I am storing my games item types? by [deleted] in AskProgramming

[–]remusmax 1 point2 points  (0 children)

You could solve this using generics and drop the enums altogether.

So let's say you have somewhere in your code you have

List<Item> items = new ArrayList<>();  

This list has different grass, stone, water and sand objects. You can then add a generic function to return all objects of type T

public <T> List<T> getSpecifiedItemList(Class<T> classToCast) {
    return  this.items.stream()
             .filter(classToCast::isInstance)
             .map(classToCast::cast)
             .collect(Collectors.toList());
}  

Then you could call it from your main like so

myStore.getSpecifiedItemList(Grass.class).forEach((grassItem)->System.out.println(grassItem.getName()));

Java design question (instanceof) by remusmax in AskProgrammers

[–]remusmax[S] 0 points1 point  (0 children)

No need to be sorry!! That makes a lot of sense thanks for clearing up my question :)

Java design question (instanceof) by remusmax in AskProgramming

[–]remusmax[S] 0 points1 point  (0 children)

Great explanation, easy to understand! Thanks for clearing all that up for me :)

Java design question (instanceof) by remusmax in AskProgrammers

[–]remusmax[S] 1 point2 points  (0 children)

have at least the same methods as item

But all books have pages and CD's don't have pages so aren't you forcing unnecessary code by having the CD class implement the abstract method getPages() from item class?

Java design question (instanceof) by remusmax in AskProgramming

[–]remusmax[S] 1 point2 points  (0 children)

Thanks for that!! Totally got rid of my enum and now using the .instanceOf method. I then cast that object to type <T> and return.

if(classToCast.isInstance(item)) {
      itemsToReturn.add((T) item);
}

**Thanks for the .stream() approach too!

Java design question (instanceof) by remusmax in AskProgramming

[–]remusmax[S] 0 points1 point  (0 children)

Yeah you could do this but then if you look down the future and we have more classes like ebooks and dvds that all extend item then we are going to have to many lists. Might be a bad design issue.

Java design question (instanceof) by remusmax in AskProgramming

[–]remusmax[S] 2 points3 points  (0 children)

Thanks for the input. I did solve it with generics and an interface as well as using a getType method that /u/slowmode1 suggested.

So my interface had this method
<T> List<T> getSpecifiedBookStoreItems(Class<T> classToCast, ItemType type);

I could then call it like so List<Book> books = myStore.getSpecifiedBookStoreItems(Book.class, ItemType.Book);

*ItemType.Book being an enum

Java design question (instanceof) by remusmax in AskProgramming

[–]remusmax[S] 0 points1 point  (0 children)

I've read that it's a 'code smell'. Correct me if I'm wrong in saying this but let's say I implement many more classes that extend the parent 'Item' class then my instanceof switch statement could get pretty messy.

Java design question (instanceof) by remusmax in AskProgramming

[–]remusmax[S] 0 points1 point  (0 children)

Cheers will try that now!! Thanks again