• 14
• 12
• 9
• 10
• 9
• ### Similar Content

• By Just4lol
Hello,
I'm looking for my dream teammate(s) to help me work on my Unity game. I still dont know where Im going with that project but I want to make a good final product that I would be able to sell or publish it for free on Steam.  Here a video of the prototype (The only thing I dint made is the skybox) https://www.youtube.com/watch?v=y2Otmt9jRkc
My discord : Just4lol#46982
I want somone at least as competent as me :
- I want somone with at least one year of experience in Unity (already worked with scriptable object and know oop).
- Already worked with shaders or can do editors tools is a plus.
- Can do 3d models in Blender or can do 2d art for the ui or particles effects.
- Can make soundtracks or sound effects a bonus.
Im a french Canadian so mind my english I will do my best to edit any errors I see.

• I am looking for talents to form a team of making a strategy base action game. Talents I am currently looking for are : -
(I) Unity programmer (mobile)
(II) Game designer
(III) 3d Artist
(IV) SFX Artist
The attachment is some game concept for the game. All the concept will be turn into 3d or card form. The game will be strategy game where the players can form their own team and control the units in the battle field real time to fight against each others.  If you are interested to know more details please pm me or send an email to damnwing0405@gmail.com

• By bsudheer
Leap Leap Leap! is a fast-paced, endless running game where you leap from rooftop to rooftop in a computer simulated world.

This is a free run game and get excited by this fabulous computer simulated world of skyscrapers and surreal colors in parallax effect. On your way, collect cubes and revival points as many as you can to make a long run.

Features of Leap Leap Leap:
-Option of two themes: Black or White.
-Simple one touch gameplay.
-Attractive art.
-Effective use of parallax.
Appstore: https://itunes.apple.com/us/app/leap-leap-leap/id683764406?mt=8

• By BillyGD

Play Flick Football 3D @ https://gamejolt.com/games/flickfootball3d/326078
Flick Football 3D is a turn based football game inspired by the table top classic 'Subbuteo'.
The game is currently in very early Alpha development. There is still a lot to be done before the first proper release but I have decided to release this playable version to get as much feedback as possible.
The only game mode currently available in this release is the 'Practice Mode' which gives you control of both teams. Either play against yourself to get used to how the game works or play against friends and family on the same computer!
Planned Future Features Include:
-Take control of your own custom team in the single player campaign.
-Play in online leagues and tournaments against other players in the multiplayer mode.
-Fully customisable stadiums to make you stand out from the rest of the players.
-Improve your players stats and skills by playing matches and setting up training sessions.
Flick Football 3D is available for Windows, Mac and Browser.
Thank you for viewing my game, all feedback is greatly appreciated. I can be contacted at; BillyGDev@outlook.com
'Flick Football 3D' is also the development name for the game and I haven't yet decided what the full release will be called, so if you have any ideas please drop me a message!
• By drcrack

It is a combination of fundamental RPG elements and challenging, session-based MOBA elements. Having features such as creating your unique build, customizing your outfit and preparing synergic team compositions with friends, players can brave dangerous adventures or merciless arena fights against deadly creatures and skilled players alike.

This time with no grinding and no pay to win features.

We're still looking for:
1) 3D Character Artist
2) 3D Environment Artist
3) Animator
4) Sound Designer
5) VFX Artist

Discord https://discord.gg/zXpY29V or drcrack#4575

# Unity Dependency Injection in an Initialiser List

This topic is 3117 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a situation where there are RAII wrapper components, B and C, that have a dependency on another, shared, RAII wrapper, A. For some reason I have a specific use of these components in mind for which I only require to create all these objects at once and destroy them at once (a more complex use might see these objects having different lifetimes). As such I would like to write a higher level component that encapsulates these components and provides an interface to express this specific use. In order to function it will need to inject an A into a B and a C. If this specific use only required the components to exist for a one-off operation then we might write a function like so:
void do_something_useful(data info)
{
// all constructed here
A a(info);
B b(a);
C c(a);

// do something with them
impl(b, c);

// all destructed here
}
We're quite used to seeing code like this, the function controls their lifetime and forwards the work off. However it is not suitable for my purpose, the objects are stateful (Hmm, state-full? ... Full-of-state [smile]) and need to persist between calls in order for this operation to work properly. The next most obvious solution, therefore, is to use a class, D, and have its ctor/dtor control their lifetime and a member function to perform the operation:
class D
{
A a;
B b;
C c;

public:
D(data info) : a(info), b(a), c(a) { }
/* ~D() - no need for an explicit destructor */

void do_something_useful();
};
This looks fine and it works fine, but it has a subtle nuance, it relies on the order of construction of members in a class to operate correctly. This is well defined, it's the order they appear in the class definition (not the order they appear in the initialisation list!). This, to me, feels slightly wrong for some reason. Maybe it's my distrust of other people not knowing their construction rules or maybe it's because, generally, I/we don't usually expect that the order of data members actually matters in the slightest. I have tried to do some searching to find other examples and opinions of this, the best I have is a post by Antheus where he claims that such designs evolve naturally in C++ as consequence of applying the IOC pattern. My question is, how do other people feel about this? Thanks.

##### Share on other sites
I can't recall any specific case where I would depend on initialization order. In most cases I've encountered the dependency was always external.

It's just an issue with usual C++ complexity, at least the order is guaranteed.

Why not just change D to take A as constructor, whereas A is constructed from info?

If state matters, then copying might be an issue anyway. If it doesn't, then A could be implicitly constructed from info. And if there are other life-cycle issues, then it doesn't make sense to force such designs, and just allocate them differently.

##### Share on other sites
Quote:
 Original post by AntheusWhy not just change D to take A as constructor, whereas A is constructed from info?
Certainly, if we assume the proposal in my post is bad, then alternatives are fairly easy to produce:
D make_d(data info){    return D(A(info));}
This seems like a likely route.

I could also use pointer types to defer construction to D's constructor body and do it all in there explicitly, but on the heap. In theory it could be the case that B and C are default constructable and fast-swappable/assignable, although they're not here I'm saying.

##### Share on other sites
I just don't see what the big deal is. Do people you work with usually randomly reorder members in classes for no reason?

##### Share on other sites
Quote:
 Original post by SiCraneI just don't see what the big deal is. Do people you work with usually randomly reorder members in classes for no reason?

Unlike passing 'this', the examples above do not generate any warnings by the compiler (at least MSVC doesn't). Change the order for whichever, and dependent objects suddenly get garbage.

I've only needed this type of dependency on a handful of very top-level objects, where order is somewhat obvious, and members don't really change.

Elsewhere, I'd simply pass info to A, B and C. That avoids the problem altogether. As always, if the shoe doesn't fit...

##### Share on other sites
Quote:
 Original post by AntheusChange the order for whichever, and dependent objects suddenly get garbage.

Yes, I understand the technical part of the OP's question. That doesn't address what I asked: do people you work with usually randomly reorder members in classes for no reason?

##### Share on other sites
Quote:
 Original post by AntheusUnlike passing 'this', the examples above do not generate any warnings by the compiler (at least MSVC doesn't). Change the order for whichever, and dependent objects suddenly get garbage.

G++ will although at the present moment I can not remember which flag gives the warning :)

##### Share on other sites
Quote:
Original post by magic_man
Quote:
 Original post by AntheusUnlike passing 'this', the examples above do not generate any warnings by the compiler (at least MSVC doesn't). Change the order for whichever, and dependent objects suddenly get garbage.

G++ will although at the present moment I can not remember which flag gives the warning :)

struct X {        int x, y;        X () : y(0), x(0) {}};

main.cc: In constructor X::X()':main.cc:2: warning: X::y' will be initialized aftermain.cc:2: warning:   int X::x'main.cc:3: warning:   when initialized here`