# Copyright (c) 2016-2017 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Autogenerated python message buffer code.
Source: clad/types/objectTypes.clad
Full command line: ../tools/message-buffers/emitters/Python_emitter.py -C ../robot/clad/src/ -o ../generated/cladPython// clad/types/objectTypes.clad
"""

from __future__ import absolute_import
from __future__ import print_function

def _modify_path():
  import inspect, os, sys
  search_paths = [
    '../..',
    '../../../../tools/message-buffers/support/python',
  ]
  currentpath = os.path.abspath(os.path.dirname(inspect.getfile(inspect.currentframe())))
  for search_path in search_paths:
    search_path = os.path.normpath(os.path.abspath(os.path.realpath(os.path.join(currentpath, search_path))))
    if search_path not in sys.path:
      sys.path.insert(0, search_path)
_modify_path()

import msgbuffers

Anki = msgbuffers.Namespace()
Anki.Cozmo = msgbuffers.Namespace()

class ObjectType(object):
  "Automatically-generated int_32 enumeration."
  InvalidObject          = -1
  UnknownObject          = 0
  Block_LIGHTCUBE1       = 1
  Block_LIGHTCUBE2       = 2
  Block_LIGHTCUBE3       = 3
  Block_LIGHTCUBE_GHOST  = 4
  FlatMat_GEARS_4x4      = 5
  FlatMat_LETTERS_4x4    = 6
  FlatMat_ANKI_LOGO_8BIT = 7
  FlatMat_LAVA_PLAYTEST  = 8
  Platform_LARGE         = 9
  Bridge_LONG            = 10
  Bridge_SHORT           = 11
  Ramp_Basic             = 12
  Charger_Basic          = 13
  ProxObstacle           = 14
  CliffDetection         = 15
  CollisionObstacle      = 16
  CustomType00           = 17
  CustomType01           = 18
  CustomType02           = 19
  CustomType03           = 20
  CustomType04           = 21
  CustomType05           = 22
  CustomType06           = 23
  CustomType07           = 24
  CustomType08           = 25
  CustomType09           = 26
  CustomType10           = 27
  CustomType11           = 28
  CustomType12           = 29
  CustomType13           = 30
  CustomType14           = 31
  CustomType15           = 32
  CustomType16           = 33
  CustomType17           = 34
  CustomType18           = 35
  CustomType19           = 36
  CustomFixedObstacle    = 37

Anki.Cozmo.ObjectType = ObjectType
del ObjectType


def IsValidLightCube(objectType, defaultValue):
  return {
    ObjectType.InvalidObject: 0,
    ObjectType.UnknownObject: 0,
    ObjectType.Block_LIGHTCUBE1: 1,
    ObjectType.Block_LIGHTCUBE2: 1,
    ObjectType.Block_LIGHTCUBE3: 1,
    ObjectType.Block_LIGHTCUBE_GHOST: 0,
    ObjectType.FlatMat_GEARS_4x4: 0,
    ObjectType.FlatMat_LETTERS_4x4: 0,
    ObjectType.FlatMat_ANKI_LOGO_8BIT: 0,
    ObjectType.FlatMat_LAVA_PLAYTEST: 0,
    ObjectType.Platform_LARGE: 0,
    ObjectType.Bridge_LONG: 0,
    ObjectType.Bridge_SHORT: 0,
    ObjectType.Ramp_Basic: 0,
    ObjectType.Charger_Basic: 0,
    ObjectType.ProxObstacle: 0,
    ObjectType.CliffDetection: 0,
    ObjectType.CollisionObstacle: 0,
    ObjectType.CustomType00: 0,
    ObjectType.CustomType01: 0,
    ObjectType.CustomType02: 0,
    ObjectType.CustomType03: 0,
    ObjectType.CustomType04: 0,
    ObjectType.CustomType05: 0,
    ObjectType.CustomType06: 0,
    ObjectType.CustomType07: 0,
    ObjectType.CustomType08: 0,
    ObjectType.CustomType09: 0,
    ObjectType.CustomType10: 0,
    ObjectType.CustomType11: 0,
    ObjectType.CustomType12: 0,
    ObjectType.CustomType13: 0,
    ObjectType.CustomType14: 0,
    ObjectType.CustomType15: 0,
    ObjectType.CustomType16: 0,
    ObjectType.CustomType17: 0,
    ObjectType.CustomType18: 0,
    ObjectType.CustomType19: 0,
    ObjectType.CustomFixedObstacle: 0,
    }.get(objectType, defaultValue)
Anki.Cozmo.IsValidLightCube = IsValidLightCube
del IsValidLightCube


def IsCharger(objectType, defaultValue):
  return {
    ObjectType.InvalidObject: 0,
    ObjectType.UnknownObject: 0,
    ObjectType.Block_LIGHTCUBE1: 0,
    ObjectType.Block_LIGHTCUBE2: 0,
    ObjectType.Block_LIGHTCUBE3: 0,
    ObjectType.Block_LIGHTCUBE_GHOST: 0,
    ObjectType.FlatMat_GEARS_4x4: 0,
    ObjectType.FlatMat_LETTERS_4x4: 0,
    ObjectType.FlatMat_ANKI_LOGO_8BIT: 0,
    ObjectType.FlatMat_LAVA_PLAYTEST: 0,
    ObjectType.Platform_LARGE: 0,
    ObjectType.Bridge_LONG: 0,
    ObjectType.Bridge_SHORT: 0,
    ObjectType.Ramp_Basic: 0,
    ObjectType.Charger_Basic: 1,
    ObjectType.ProxObstacle: 0,
    ObjectType.CliffDetection: 0,
    ObjectType.CollisionObstacle: 0,
    ObjectType.CustomType00: 0,
    ObjectType.CustomType01: 0,
    ObjectType.CustomType02: 0,
    ObjectType.CustomType03: 0,
    ObjectType.CustomType04: 0,
    ObjectType.CustomType05: 0,
    ObjectType.CustomType06: 0,
    ObjectType.CustomType07: 0,
    ObjectType.CustomType08: 0,
    ObjectType.CustomType09: 0,
    ObjectType.CustomType10: 0,
    ObjectType.CustomType11: 0,
    ObjectType.CustomType12: 0,
    ObjectType.CustomType13: 0,
    ObjectType.CustomType14: 0,
    ObjectType.CustomType15: 0,
    ObjectType.CustomType16: 0,
    ObjectType.CustomType17: 0,
    ObjectType.CustomType18: 0,
    ObjectType.CustomType19: 0,
    ObjectType.CustomFixedObstacle: 0,
    }.get(objectType, defaultValue)
Anki.Cozmo.IsCharger = IsCharger
del IsCharger


