Questions tagged [instances]

An instance is a specific realization of any object.

516 questions
0
votes
2 answers

Make a function return something with different properties

I'll get straight to the point. To be honest, I think there is an answer to this, but I don't know how to word it. int playerXCoord = Player.getPosition().x //this is just an example How do you define something in C++? I am familiar with classes…
Ricky
  • 122
  • 1
  • 1
  • 9
0
votes
2 answers

Is it possible to create a constructor for Arrays c#?

I am new to coding and still at college at the moment. Sorry if this question has been asked before but I could not see it any where. I was wonder if it is possible to create a constructor for the array Class, so each time I create a new array I…
Sifer
  • 57
  • 1
  • 6
0
votes
2 answers

Using enums and a for-loop to create instances of a class

enum { WOOD, BRICK, GRAIN, HEMP, WOOL, RAWMETAL, HONEY, SALT, METALGOODS, MEAD, CLOTH, BEER, STOCKFISH, CLOTHING, CHEESE, PITCH, PELTS, MEAT, WINE, SPICES, TOTALRESOURCES }; // An array of strings for each of the resource names // As long as these…
0
votes
0 answers

C++ read and write multiple objects

I'm learning C++ and i'm creating a simple project for practice. Now i want to save multiple instances of the same class that are stored in a vector. I tried to save the whole vector in a binary file using ofstream, but the result was…
Mike T
  • 1
  • 1
0
votes
1 answer

Haskell syntax for instance

I'm trying to make a pair an instance of Printable, but I can't figure out the correct syntax. My Printable is this: class Printable a where toString :: a -> [Char] instance Printable Bool where toString True = "true" toString False =…
Chiffa
  • 1,486
  • 2
  • 19
  • 38
0
votes
1 answer

How to maintain an internal array of instances of a class?

I'm trying to maintain an internal array of all the instances of a given class. When one is naturally dealloc'd it should be removed from that static array. However, dealloc will never get called if [instances addObject:weakSelf] is uncommented.…
Chan
  • 269
  • 1
  • 13
0
votes
1 answer

Azure Pricing Clarification - Instances

I am looking to move my websites from sitting on an Azure VM to being in an App Service. In the App service there are several items in the Pricing I don't understand and cannot find answers too. Do you know what these items means? "Up to 10…
user1117617
0
votes
2 answers

Why are instances overwriting each other in LibGDX?

So I have this game I'm making with LibGDX. I have a GroundTop and Ground class that draws the ground and ground top on the screen (image loading in an Assets class), and will eventually apply collisions with the player (this is a platformer). What…
0
votes
2 answers

C# infinite instances of a class

Can I create a virtually infinite number of instances of a class? Or can you tell me a better way to do this? Here's my problem, I want to make a program that lets you create circles by clicking on the screen, they have to be displayed and to…
0
votes
1 answer

Issues adding instancing to a working sprite system

I'm trying to implement instancing into my 2d Game Engine so that it can support particle systems without losing any performance. My class, ISprite, is derived from a working Sprite class. I just went through and removed all the functionality…
red_always_mafia
  • 179
  • 2
  • 10
0
votes
1 answer

Python: Changing the value of an instance from a list comprehension

Teaching myself python at the moment and I am trying to make a simple payment script, I've hit a bit of a block here, I have tried to use a function to construct a simple send payment between two customers using list comprehension def…
cyclopse87
  • 619
  • 2
  • 11
  • 22
0
votes
1 answer

Using a method to generate multiple instances of another class

I am trying to let a method initiate multiple instances of another class. class Players def initialize(players) @players = players end def generate_boards @players.each do |player| board = BingoBoardGenerator.new player…
Nick P
  • 20
  • 3
0
votes
2 answers

Swift Arrays with Controls/Instances

Is it possible to have arrays of UIImageViews? If so, how? I wrote this thinking it would work, but I get errors (so it's definitely wrong): let Array_of_UIImageViews = [@IBOutlet weak var T1: UIImageView!,@IBOutlet weak var T2:…
Adam G.
  • 107
  • 1
  • 8
0
votes
2 answers

delete list of instance from iteratively created list of instances

I have created a list of instances (with a for loop). When I try to delete single instances from this list I get an error saying they aren't in the list. I have made a simple example showing my problem: class example (): list = [] def…
Christoph Müller
  • 483
  • 1
  • 5
  • 16
0
votes
1 answer

Pickadate changes date on multiple template instances in meteor

I am trying to use the 'pickadate' package in MeteorJS but 'pickadate' changes the date in all template instances instead of just the one where I want.

Datepicker

{{> myTemplate}} {{>…
Ferenc
  • 884
  • 9
  • 19