Search found 794 matches

by cameron
December 15th, 2018, 9:41 pm
Forum: Everything
Topic: TypeList Implimentation
Replies: 2
Views: 1736

TypeList Implimentation

So I've been fooling around with typelists for the past couple weeks and put together a type_list class with a bunch of facilities. I found tuple to be insufficient for my needs and there is no standard implementation for any of this. https://github.com/BobsCrabShack/FunctionAny_Test Side note: I sp...
by cameron
December 15th, 2018, 8:08 pm
Forum: Everything
Topic: c++ how to have the cpu keep choosing a play from a menu
Replies: 6
Views: 3188

Re: c++ how to have the cpu keep choosing a play from a menu

I'm not sure I entirely understand what you mean by "keep choosing a play while on offense." In most programs, they run on a single thread. Meaning only 1 task happens at a time. In a multithreaded situation, multiple things can be done at once. However, in this instance single threaded is surely wh...
by cameron
December 12th, 2018, 7:07 am
Forum: Everything
Topic: C++ text based football — lookup table and AI logic help
Replies: 7
Views: 3430

Re: C++ text based football — lookup table and AI logic help

Honestly, if you haven't even gone through all the beginner tutorials don't worry about decision trees or any ai algorithms of the likes. I haven't even gotten into those yet. Simple if statements should suffice. Really if you want lots of advanced ai behavior then yeah... maybe come back to it anot...
by cameron
December 10th, 2018, 12:22 am
Forum: Everything
Topic: C++ text based football — lookup table and AI logic help
Replies: 7
Views: 3430

Re: C++ text based football — lookup table and AI logic help

Not sure I completely understand what you are trying to do but ill take a stab at it. It would help keep things clean if you put things into structs/classes and help make things a little more uniform for developing the logic. This could be done even nicer when you learn more but don't worry too much...
by cameron
November 24th, 2018, 10:15 pm
Forum: Everything
Topic: Long time no see and Input Capture
Replies: 56
Views: 22536

Re: Long time no see and Input Capture

Ok... I have it mostly working (LOL). It now works for all non-reference return types. Turns out it was an issue with duplicates in the variadic template. Had to put together another hack to remove the duplicates. This is really turning out to be template city. On the other hand, this is quite sexy,...
by cameron
November 24th, 2018, 8:10 pm
Forum: Everything
Topic: Long time no see and Input Capture
Replies: 56
Views: 22536

Re: Long time no see and Input Capture

Yeah std::any is gonna lose any type information with it though its not a terrible solution I suppose. Been trying to return an std::variant with all the return types. I mostly have it working but I cant seem to get the void type working. I created a dummy VOID struct but it's having conversion erro...
by cameron
November 24th, 2018, 12:37 am
Forum: Everything
Topic: Long time no see and Input Capture
Replies: 56
Views: 22536

Re: Long time no see and Input Capture

Looks like I finally got something working. However, I'm not able to get different return types working because std::visit requires a single return type. Side note: templates are fun but this is literally templated hell. I had to create a FunctionTraits header just because of the dummy structs I've ...
by cameron
November 23rd, 2018, 9:00 am
Forum: Everything
Topic: Long time no see and Input Capture
Replies: 56
Views: 22536

Re: Long time no see and Input Capture

Yeah, sorry forgot to paste the updated code for that. Also there was a contributing error because of explicitly passing the Args... to MakeFunc. With perfect forwarding, explicitly specifying the types messes things up. Anyways... Im pretty sure I got that mostly working. Trying out a FunctionAny c...
by cameron
November 22nd, 2018, 10:13 pm
Forum: Everything
Topic: Long time no see and Input Capture
Replies: 56
Views: 22536

Re: Long time no see and Input Capture

Seems it ended up being an issue with the lambda capture. Had to do a hack with std::tuple and std::apply to get perfect forwarding with lambda capture.
by cameron
November 22nd, 2018, 7:27 am
Forum: Everything
Topic: Long time no see and Input Capture
Replies: 56
Views: 22536

Re: Long time no see and Input Capture

I didn't think you'd need the typename portion, since the resolution was on a templated type not a regular type, but whatevs, glad it helped. It is necessary, as far as I can tell. I tried without it and it wouldn't compile. You have to use a dummy template parameter. Not possible with a parameter ...