コード例 #1
0
        public object getProperty(string actorName, Map.EActorProperties property)
        {
            object propertyVal = null;

            foreach (CComponent component in _componentRegistry)
            {
                if ((propertyVal = component.getProperty(actorName, property)) != null)
                {
                    return(propertyVal);
                }
            }

            return(propertyVal);
        }
コード例 #2
0
ファイル: CComponent.cs プロジェクト: mzaman07/kot-mono
        public object getProperty(string actorName, Map.EActorProperties property)
        {
            if (!actors.Keys.Contains(actorName))
            {
                if (root.name == actorName)
                {
                    return(propertySwitch(root, property));
                }
                return(null);
            }

            CActor actor = actors[actorName];

            return(propertySwitch(actor, property));
        }
コード例 #3
0
ファイル: CComponent.cs プロジェクト: mzaman07/kot-mono
        private object propertySwitch(CActor actor, Map.EActorProperties property)
        {
            switch (property)
            {
            case Map.EActorProperties.POSITION:
                return(actor.position);

            case Map.EActorProperties.COMPONENT_ADDRESS:
                return(actor.componentAddress);

            case Map.EActorProperties.OLD_POSITION:
                return(actor.oldPosition);

            case Map.EActorProperties.DIRECTION:
                return(actor.direction);

            default:
                return(null);
            }
        }
コード例 #4
0
 public static object propertyGetterFromComponent(int componentAddress, string actorName, Map.EActorProperties property)
 {
     return(_currentMap.getProperty(componentAddress, actorName, property));
 }
コード例 #5
0
 public static object propertyGetter(string actorName, Map.EActorProperties property)
 {
     return(_currentMap.getProperty(actorName, property));
 }