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

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

            return null;
        }
示例#3
0
        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;
        }
示例#4
0
        public virtual bool contains(State.EntityState state){
            foreach (KeyValuePair<State.EntityState, GraphicsSet> pair in this.graphics){
                if (pair.Key == state)
                    return true;
            }

            return false;
        }
示例#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;
        }
示例#6
0
 public virtual void addGraphics(State.EntityState state, GraphicsSet set){
     if (!this.contains(state))
         this.graphics.Add(new KeyValuePair<State.EntityState, GraphicsSet>(state, set));
 }
示例#7
0
        public MenuItemWithInput(string text, State.MenuState target):this(text){

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