Exemplo n.º 1
0
 public Pollen(WorldSectionStateGenerator generator)
 {
     this.Id = generator.NextEntityId();
     // The position is a relative value. The UI can scale
     // these values to the 'true' range.
     this.PositionX = generator.NextValue(-1.0f, 1.0f);
     this.PositionY = generator.NextValue(-1.0f, 1.0f);
 }
Exemplo n.º 2
0
    public Flower(WorldSectionStateGenerator generator)
    {
        this.Id        = generator.NextEntityId();
        this.PositionX = generator.NextPosition();
        this.PositionY = generator.NextPosition();

        var lPollenCount = generator.NextValue(2, 10);
        var lPollenArray = new Pollen[lPollenCount];

        this.Pollen = lPollenArray;

        for (var lIndex = 0; lIndex < lPollenCount; lIndex++)
        {
            lPollenArray[lIndex] = new Pollen(generator);
        }
    }
Exemplo n.º 3
0
    public WorldSection(int gameSeed, int xPos, int yPos)
    {
        this.PositionX = xPos;
        this.PositionY = yPos;

        var lGenerator = new WorldSectionStateGenerator(gameSeed, xPos, yPos);

        var lFlowerCount = lGenerator.NextValue(1, 4);
        var lFlowerArray = new Flower[lFlowerCount];

        this.Flowers = lFlowerArray;

        for (var lIndex = 0; lIndex < lFlowerCount; lIndex++)
        {
            lFlowerArray[lIndex] = new Flower(lGenerator);
        }
    }