コード例 #1
0
ファイル: GameRenderer.cs プロジェクト: dav793/2D-Survival
    /*
     * Add operation on all objects in sector to a render update queue
     */
    public void ScheduleUpdateOnSectorObjects(RenderObjectUpdateOperations operation, WorldSector sector)
    {
        for (int x = sector.lower_boundary_x; x < sector.upper_boundary_x; ++x)
        {
            for (int y = sector.lower_boundary_y; y < sector.upper_boundary_y; ++y)
            {
                GTile tile = GameData.GData.getTile(new Vector2(x, y));
                // schedule structures
                for (int i = 0; i < tile.Contained_Objects.structures.all.count(); ++i)
                {
                    ScheduleObjectUpdate(operation, tile.Contained_Objects.structures.all.getObjectAt(i));
                }
                // schedule items
                for (int i = 0; i < tile.Contained_Objects.items.all.count(); ++i)
                {
                    ScheduleObjectUpdate(operation, tile.Contained_Objects.items.all.getObjectAt(i));
                }
            }
        }

        // schedule actors
        for (int i = 0; i < sector.Contained_Objects.actors.all.count(); ++i)
        {
            ScheduleObjectUpdate(operation, sector.Contained_Objects.actors.all.getObjectAt(i));
        }
    }
コード例 #2
0
ファイル: GameRenderer.cs プロジェクト: dav793/2D-Survival
 public void ScheduleUpdateOnAllObjects(RenderObjectUpdateOperations operation)
 {
     for (int i = 0; i < renderedSectors.Count; ++i)
     {
         ScheduleUpdateOnSectorObjects(operation, renderedSectors[i]);
     }
 }
コード例 #3
0
    public Queue <GObject> getOperationQueue(RenderObjectUpdateOperations operation)
    {
        switch (operation)
        {
        case RenderObjectUpdateOperations.CREATE:
            return(create);

        case RenderObjectUpdateOperations.DESTROY:
            return(destroy);

        case RenderObjectUpdateOperations.UPDATE_POSITION:
            return(update_position);

        case RenderObjectUpdateOperations.UPDATE_BRIGHTNESS:
            return(update_brightness);

        case RenderObjectUpdateOperations.UPDATE_TINT:
            return(update_tint);

        case RenderObjectUpdateOperations.UPDATE_TRANSPARENCY:
            return(update_transparency);

        case RenderObjectUpdateOperations.UPDATE_ANIMATION:
            return(update_animation);
        }
        return(null);
    }
コード例 #4
0
 public Queue<GObject> getOperationQueue(RenderObjectUpdateOperations operation)
 {
     switch(operation) {
     case RenderObjectUpdateOperations.CREATE:
         return create;
     case RenderObjectUpdateOperations.DESTROY:
         return destroy;
     case RenderObjectUpdateOperations.UPDATE_POSITION:
         return update_position;
     case RenderObjectUpdateOperations.UPDATE_BRIGHTNESS:
         return update_brightness;
     case RenderObjectUpdateOperations.UPDATE_TINT:
         return update_tint;
     case RenderObjectUpdateOperations.UPDATE_TRANSPARENCY:
         return update_transparency;
     case RenderObjectUpdateOperations.UPDATE_ANIMATION:
         return update_animation;
     }
     return null;
 }
コード例 #5
0
ファイル: GameRenderer.cs プロジェクト: dav793/2D-Survival
 /*
  * Add operation on object to a render update queue
  */
 public void ScheduleObjectUpdate(RenderObjectUpdateOperations operation, GObject obj)
 {
     ObjectUpdateQueues.getOperationQueue(operation).Enqueue(obj);
 }
コード例 #6
0
ファイル: GameRenderer.cs プロジェクト: dav793/2D-Survival
 /*
  * Add operation on object to a render update queue
  */
 public void ScheduleObjectUpdate(RenderObjectUpdateOperations operation, GObject obj)
 {
     ObjectUpdateQueues.getOperationQueue (operation).Enqueue(obj);
 }
コード例 #7
0
ファイル: GameRenderer.cs プロジェクト: dav793/2D-Survival
    /*
     * Add operation on all objects in sector to a render update queue
     */
    public void ScheduleUpdateOnSectorObjects(RenderObjectUpdateOperations operation, WorldSector sector)
    {
        for (int x = sector.lower_boundary_x; x < sector.upper_boundary_x; ++x) {
            for (int y = sector.lower_boundary_y; y < sector.upper_boundary_y; ++y) {
                GTile tile = GameData.GData.getTile(new Vector2(x, y));
                // schedule structures
                for(int i = 0; i < tile.Contained_Objects.structures.all.count(); ++i) {
                    ScheduleObjectUpdate(operation, tile.Contained_Objects.structures.all.getObjectAt(i));
                }
                // schedule items
                for(int i = 0; i < tile.Contained_Objects.items.all.count(); ++i) {
                    ScheduleObjectUpdate(operation, tile.Contained_Objects.items.all.getObjectAt(i));
                }
            }
        }

        // schedule actors
        for (int i = 0; i < sector.Contained_Objects.actors.all.count(); ++i) {
            ScheduleObjectUpdate(operation, sector.Contained_Objects.actors.all.getObjectAt(i));
        }
    }
コード例 #8
0
ファイル: GameRenderer.cs プロジェクト: dav793/2D-Survival
 public void ScheduleUpdateOnAllObjects(RenderObjectUpdateOperations operation)
 {
     for (int i = 0; i < renderedSectors.Count; ++i) {
         ScheduleUpdateOnSectorObjects(operation, renderedSectors[i]);
     }
 }