コード例 #1
0
ファイル: SeatTests.cs プロジェクト: KarmaLaBelle/GameWorld2
 public void Setup()
 {
     D.onDLog += Console.WriteLine;
     WorldTestHelper.GenerateInitData();
     InitialSaveFileCreator i = new InitialSaveFileCreator();
     _world = new World(i.CreateRelay("../InitData1/"));
     _adam = _world.tingRunner.GetTing<Character>("Adam");
     _seat = _world.tingRunner.CreateTing<Seat>("Chair", new WorldCoordinate("Eden", 0, 3));
 }
コード例 #2
0
ファイル: Character.cs プロジェクト: KarmaLaBelle/GameWorld2
        public void Sit(Seat pSeat)
        {
            if(pSeat == null) {
                D.LogError(name + " is trying to sit on pOtherTing that is null");
                return;
            }

            if(seat == null) {
                seat = pSeat;
            }

            //D.Log("Sit called for " + name + " on seat " + pSeat);

            direction = pSeat.direction;
            position = pSeat.position;
            StopAction();
            sitting = true;

            var possibleComputerTile = room.GetTile(seat.computerPoint);
            if (possibleComputerTile != null) {
                var computerInFrontOfChair = possibleComputerTile.GetOccupantOfType<Computer>();
                if (computerInFrontOfChair != null) {
                    if (rememberToHackComputerAfterSittingDown) {
                        Hack (computerInFrontOfChair);
                    } else {
                        InteractWith (computerInFrontOfChair);
                    }
                }
            }
        }