Beispiel #1
0
 public void Reply()
 {
     if (Done)
     {
         throw Dj.Crash("Can only REPLY or REJECT one time on a PostAssistant");
     }
     message.Respond(Capn.Crunchatize(reply), ResponseStatus.Success);
     Done = true;
 }
Beispiel #2
0
 public WorldData(bool generateNew)
 {
     if (generateNew == false)
     {
         throw Dj.Crash("WorldData(false) is illegal");
     }
     towerZones   = new Dictionary <twin, TowerZone>();
     entitiesById = new Dictionary <int, TowerEntity>();
 }
Beispiel #3
0
 new public Char Setup()
 {
     base.Setup();
     if (font == null)
     {
         throw Dj.Crash("'Char' prototype " + this.gameObject.name + " doesn't have a Font assigned");
     }
     return(this);
 }
Beispiel #4
0
 public void Reject(ResponseStatus status)
 {
     if (Done)
     {
         throw Dj.Crash("Can only REPLY or REJECT one time on a PostAssistant");
     }
     if (status == ResponseStatus.Success)
     {
         throw Dj.Crashf("{0} is not a valid REJECTION status", status);
     }
     message.Respond(status);
     Done = true;
 }
Beispiel #5
0
 //// PUBLIC
 public void SetState(State state)
 {
     if (state == null)
     {
         throw Dj.Crash("XXI.SetState cannot accept a null State parameter");
     }
     if (this.state != null)
     {
         this.state.Deactivated();
     }
     this.state = state;
     this.state.Activated();
 }
Beispiel #6
0
        override protected void Initialize()
        {
            ins = this;

            this.options = InitializeOptions();
            if (authorCell == null)
            {
                throw Dj.Crash("AuthorXXI requires [authorCell] to be set in inspector");
            }
            this.authorCellBank = GetBank(authorCell.name);
            if (authorCursor == null)
            {
                throw Dj.Crash("AuthorXXI requires [authorCursor] to be set in inspector");
            }
            this.authorCursorBank = GetBank(authorCursor.name);

            this.currentRoomGridString = "";
            SetRoomCoord(options.pos_startingRoom, null);

            this.keyToCellValue = new Dictionary <KeyCode, ushort>();
            Input_SetKeyCellValue(KeyCode.Q, 0);
            for (int i = 0; i < 9; i++)
            {
                Input_SetKeyCellValue(KeyCode.Alpha1 + i, (ushort)(1 + i));
            }

            this.InitializeStates();
            if (this.state_play == null)
            {
                throw Dj.Crash(name + ".state_play is null. did you override InitializeStates badly?");
            }
            if (this.state_edit == null)
            {
                throw Dj.Crash(name + ".state_edit is null. did you override InitializeStates badly?");
            }
            if (this.state_editpalette == null)
            {
                throw Dj.Crash(name + ".state_editpalette is null. did you override InitializeStates badly?");
            }
            SetState(state_edit);
        }