Exemplo n.º 1
0
 public void onActorLocationChanged(BoardActor boardActor, Point newLocation)
 {
     // give our actor a new position in the quad tree
     actors.Remove(boardActor, boardActor.getBounds());
     boardActor.location = newLocation;
     actors.Add(boardActor, boardActor.getBounds());
 }
Exemplo n.º 2
0
        public void addActor(BoardActor ba)
        {
            if (ba != null)
            {
                actors.Add(ba, ba.getBounds());
                ba.setBoard(this);
            }

            onBoardChanged();
        }
Exemplo n.º 3
0
        public BoardActor createActor(int x, int y, String filename, AssetDetails argDetails)
        {
            BoardActor r = null;

            if (dispatcher != null)
            {
                r = new BoardActor(x, y, filename);
                r.loadAsset(filename, dispatcher, argDetails);
            }
            else
            {
                Logger.log("SceneManager: Warning - board actor creation failed, no dispatcher set", LEVEL.WARNING);
            }

            return(r);
        }
Exemplo n.º 4
0
        public BoardActor getTopActorAt(Point p)
        {
            BoardActor r = null;

            List <BoardActor> actorlist = actors.getObjectsAt(p);

            if (actorlist != null)
            {
                try {
                    foreach (BoardActor ba in actorlist)
                    {
                        if (ba.isAt(p))
                        {
                            r = ba;
                        }
                    }
                } catch (InvalidOperationException e) {
                    Console.WriteLine("Error Board::getActorAt: " + e.Message);
                }
            }

            return(r);
        }
Exemplo n.º 5
0
 public void deleteActor(BoardActor ba)
 {
     actors.Remove(ba, ba.getBounds());
     ba.setBoard(null);
     onBoardChanged();
 }
Exemplo n.º 6
0
 public SceneActorLoadAssetEvent(BoardActor ba, AssetDetails at)
 {
     actor   = ba;
     details = at;
 }
Exemplo n.º 7
0
 public SceneActorLoadAssetEvent()
 {
     actor   = null;
     details = new AssetDetails(AssetType.IMAGE);
 }