コード例 #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());
 }
コード例 #2
0
        public void addActor(BoardActor ba)
        {
            if (ba != null)
            {
                actors.Add(ba, ba.getBounds());
                ba.setBoard(this);
            }

            onBoardChanged();
        }
コード例 #3
0
ファイル: SceneManager.cs プロジェクト: vgeirnaert/boardsoup
        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);
        }
コード例 #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);
        }
コード例 #5
0
 public void deleteActor(BoardActor ba)
 {
     actors.Remove(ba, ba.getBounds());
     ba.setBoard(null);
     onBoardChanged();
 }
コード例 #6
0
 public SceneActorLoadAssetEvent(BoardActor ba, AssetDetails at)
 {
     actor   = ba;
     details = at;
 }
コード例 #7
0
 public SceneActorLoadAssetEvent()
 {
     actor   = null;
     details = new AssetDetails(AssetType.IMAGE);
 }