On Sunday, 24 May 2020 at 00:51:17 UTC, Jonathan M Davis wrote:
On Saturday, May 23, 2020 4:43:04 PM MDT Tim via
Digitalmars-d-learn wrote:
It is but I want to make sure for other cases in the future
where I create a new class that inherits from GameObject. This
was I can avoid future bugs by e
On Saturday, May 23, 2020 4:43:04 PM MDT Tim via Digitalmars-d-learn wrote:
> It is but I want to make sure for other cases in the future where
> I create a new class that inherits from GameObject. This was I
> can avoid future bugs by ensure that all classes in the future
> that inherit from GameO
On Saturday, 23 May 2020 at 22:15:49 UTC, Ali Çehreli wrote:
Is it not already called? I tried the following and it seems to
work:
import std.stdio;
GameObject[1] world;
enum layer = 0;
/// Base class of most objects in the game
class GameObject{
this(){
world[layer] = this;
writeln
On 5/23/20 3:04 PM, Tim wrote:
I have a base class GameObject:
/// Base class of most objects in the game
class GameObject{
this(){
world[layer] = this;
}
abstract void update(){}
void draw(){}
}
I want to make sure that whenever a class inherits from this, the ba
I have a base class GameObject:
/// Base class of most objects in the game
class GameObject{
this(){
world[layer] = this;
}
abstract void update(){}
void draw(){}
}
I want to make sure that whenever a class inherits from this, the
base constructor is always called. Eit
On Saturday, 23 May 2020 at 09:48:57 UTC, Mike Parker wrote:
Since you're using classes, one way is to use a common base
class or an interface. But assuming "parent" is the owner of
the Sprite instance, you might eliminate the dependency on the
parent and have it update the Sprite's position wh
On Saturday, 23 May 2020 at 15:47:59 UTC, Russel Winder wrote:
Hi,
I thought I would try and do the async version of my mock
AVR850 using the vibe.d TCP stuff. This is not HTTP, it is
proper networking! ;-)
Problem one is that vibe.d sever processes never seem to
terminate.
I am using run
Can you make dub ignore dependencies when building docs?
On 5/23/20 11:15 AM, Pavel Shkadzko wrote:> I have tried to implement a
simple flatten function for multidimensional
> I'd like to clarify a couple of questions first.
>
> How come Phobos doesn't have "flatten" function for arrays?
We call in 'joiner'.
I wrote something like this:
import std.
On Saturday, 23 May 2020 at 17:57:22 UTC, Russel Winder wrote:
On Sat, 2020-05-23 at 16:56 +, bauss via
Digitalmars-d-learn wrote: […]
Had similar experiences on non-windows platforms.
I forgot to mention I was on Linux (Debian Sid).
I am (sort of) pleased it isn't just me – definitely u
I have tried to implement a simple flatten function for
multidimensional arrays with recursive templates but got stuck.
Then I googled a little and stumped into complex
https://rosettacode.org/wiki/Flatten_a_list#D implementation
which requires your arrays to be either TreeList or Algebraic.
T
On Sat, 2020-05-23 at 16:56 +, bauss via Digitalmars-d-learn wrote:
[…]
>
> Had similar experiences on non-windows platforms.
I forgot to mention I was on Linux (Debian Sid).
I am (sort of) pleased it isn't just me – definitely unhappy it has happened
to others as well.
> I think the soluti
On Saturday, 23 May 2020 at 15:47:59 UTC, Russel Winder wrote:
Hi,
I thought I would try and do the async version of my mock
AVR850 using the vibe.d TCP stuff. This is not HTTP, it is
proper networking! ;-)
Problem one is that vibe.d sever processes never seem to
terminate.
I am using run
Hi,
I thought I would try and do the async version of my mock AVR850 using the
vibe.d TCP stuff. This is not HTTP, it is proper networking! ;-)
Problem one is that vibe.d sever processes never seem to terminate.
I am using runApplication or more likely runEventLoop in my main but it never
return
On Tuesday, 19 May 2020 at 10:05:00 UTC, BoQsc wrote:
On Monday, 18 May 2020 at 20:00:51 UTC, BoQsc wrote:
I'm kind of stuck right now on how.
Some more Updates and it seems that it is impossible to scroll
the history of the output.
Some relevant discussion:
https://stackoverflow.com/a
Is it possible to have a pointer to a nogc array?
Like for regular arrays you can just do .ptr
How would you do the same for a nogc array?
The reason is I need to read different types of values from a
nogc byte array.
Ex. reading an int at offset 12 of the array.
With normal arrays it can b
On Saturday, 23 May 2020 at 09:27:46 UTC, Tim wrote:
Hi all, I'm a little new to D and I'm wondering how I can store
a reference to the calling object. I want to create a reference
to an object's parent so that each time I go to update the
sprite, it is able to grab its position from the parent
On Saturday, 23 May 2020 at 09:27:46 UTC, Tim wrote:
Hi all, I'm a little new to D and I'm wondering how I can store
a reference to the calling object. I want to create a reference
to an object's parent so that each time I go to update the
sprite, it is able to grab its position from the parent
23.05.2020 12:27, Tim пишет:
class Sprite{
/// Postional components of the sprite
int* x, y;
SDL_Surface* image_surface;
auto parent;
this(const char* path, auto parent){
writeln(*x);
this.parent = parent;
}
void update(){
// Copy lo
Hi all, I'm a little new to D and I'm wondering how I can store a
reference to the calling object. I want to create a reference to
an object's parent so that each time I go to update the sprite,
it is able to grab its position from the parent.
So if I have:
class Sprite{
/// Postional com
On Friday, 22 May 2020 at 22:44:17 UTC, H. S. Teoh wrote:
On Fri, May 22, 2020 at 09:39:16PM +, Vinod K Chandran via
Digitalmars-d-learn wrote: [...]
So in the same manner, i want
void function(Base) = fnPtr wiil work with
void function(Child)
You cannot, because that's type unsafe:
On Friday, 22 May 2020 at 22:40:50 UTC, Steven Schveighoffer
wrote:
On 5/22/20 5:39 PM, Vinod K Chandran wrote:
[...]
That is the opposite of what you are thinking. A function
pointer has to be valid based on its parameter types. Covariant
functions are allowed.
This is OK:
void function(
22 matches
Mail list logo