Beispiel #1
0
        public MenuItem(string text, State.MenuState target){
            this.text = text;
            this.target = target;

            if (this.target == State.MenuState.NULL)
                this.disabled = true;
        }
Beispiel #2
0
        public BaseComponent getComponent(State.ComponentType type){
            foreach(BaseComponent c in this.components){
                if (c.type == type)
                    return c;
            }

            return null;
        }
        public virtual GraphicsSet getGraphicsByState(State.EntityState state){
            foreach(KeyValuePair<State.EntityState, GraphicsSet> pair in this.graphics){
                if (pair.Key == state)
                    return pair.Value;
            }

            return null;
        }
        public virtual bool contains(State.EntityState state){
            foreach (KeyValuePair<State.EntityState, GraphicsSet> pair in this.graphics){
                if (pair.Key == state)
                    return true;
            }

            return false;
        }
Beispiel #5
0
        public virtual GameTexture getCurrentGraphic(ref State.DirectionState orientation){
            switch(orientation){
                case State.DirectionState.EAST: return this.east;
                case State.DirectionState.NORTH: return this.north;
                case State.DirectionState.NORTH_EAST: return this.north_east;
                case State.DirectionState.NORTH_WEST: return this.north_west;
                case State.DirectionState.SOUTH: return this.south;
                case State.DirectionState.SOUTH_EAST: return this.south_east;
                case State.DirectionState.SOUTH_WEST: return this.south_west;
                case State.DirectionState.WEST: return this.west;
            }

            return null;
        }
 public virtual void addGraphics(State.EntityState state, GraphicsSet set){
     if (!this.contains(state))
         this.graphics.Add(new KeyValuePair<State.EntityState, GraphicsSet>(state, set));
 }
        public MenuItemWithInput(string text, State.MenuState target):this(text){

        }
Beispiel #8
0
 public MenuItem(string text, State.MenuState target, bool disabled) : this(text, target){
     this.disabled = disabled;
 }